Skip to content

Bug: 2 ansiblejobs were created when "Disabled+Manual" mode #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

yiraeChristineKim
Copy link
Contributor

@yiraeChristineKim yiraeChristineKim commented Jun 14, 2023

Description of problem:
There are two ansiblejobs created when a disabled policy is configured with "Disabled + Manual" mode in some creds.

Solution: Add resourceVersion verification

Ref: https://issues.redhat.com/browse/ACM-5644

cleanupPolicyAutomation()
})
})
Describe("Test manual run and diable", func() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just put this test into a separate test for fast testing

})
})
Describe("Test manual run and diable", func() {
It("Change policy to disabled and create policyAutomation with disabled", func() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here start new test

@yiraeChristineKim yiraeChristineKim requested a review from mprahl June 15, 2023 17:38
Copy link
Member

@JustinKuli JustinKuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall!

Comment on lines 88 to 92
ansiblejobLen := len(ansiblejobList.Items)
// Check whether new PolicyAutomation
if ansiblejobLen == 0 {
return false, nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this isn't a problem, but it's not necessary. If the list is empty, the loop will be skipped, and it will just return false, nil anyway.


return len(ansiblejobList.Items)
}, 30, 1).Should(Equal(1))
Describe("Test PolicyAutomation Maunul run", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Describe("Test PolicyAutomation Maunul run", func() {
Describe("Test PolicyAutomation Manual run", func() {

…l" mode

Solution:  Add resourceV verification

Signed-off-by: Yi Rae Kim <[email protected]>
@openshift-ci
Copy link

openshift-ci bot commented Jun 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mprahl, yiraeChristineKim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [mprahl,yiraeChristineKim]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants