-
Notifications
You must be signed in to change notification settings - Fork 22
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
Bug: 2 ansiblejobs were created when "Disabled+Manual" mode #116
Conversation
fb008f8
to
ecadafe
Compare
cleanupPolicyAutomation() | ||
}) | ||
}) | ||
Describe("Test manual run and diable", func() { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here start new test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall!
controllers/common/ansible.go
Outdated
ansiblejobLen := len(ansiblejobList.Items) | ||
// Check whether new PolicyAutomation | ||
if ansiblejobLen == 0 { | ||
return false, nil | ||
} |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]>
ecadafe
to
e87c638
Compare
[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:
Approvers can indicate their approval by writing |
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