-
Notifications
You must be signed in to change notification settings - Fork 24
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
OCPBUGS-29272: Delete scan when SSB remove a profile #492
Conversation
@Vincent056: This pull request references Jira Issue OCPBUGS-29272, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
6529817
to
5dacf2e
Compare
tests/e2e/serial/main_test.go
Outdated
} | ||
|
||
// Check if the scan for `ocp4-moderate` profile is removed | ||
if err := f.AssertScanDoesNotExist("ocp4-moderate", f.OperatorNamespace); err != 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.
Another assertion we could add to this test would be to make sure all ComplianceCheckResults
that belong to the ocp4-moderate
profile's scans are also deleted.
Looks great, just a few comments inline about testing. |
4aa7b72
to
de01cd1
Compare
tests/e2e/serial/main_test.go
Outdated
|
||
// Make sure the checkresult is deleted as well | ||
err = f.AssertHasCheck(bindingName, scanName, checkResult) | ||
if err == 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.
Shouldn't this be not equals?
de01cd1
to
cb41069
Compare
/retest |
2 similar comments
/retest |
/retest |
a1a2d4e
to
472354e
Compare
tests/e2e/serial/main_test.go
Outdated
if err := f.Client.Get(context.TODO(), types.NamespacedName{Namespace: f.OperatorNamespace, Name: checkResult.Name}, ccr); err != nil { | ||
log.Printf("failed to get check %s: %s\n", checkResult.Name, err) | ||
} else { | ||
log.Printf("Object: %s\n", ccr) |
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.
This test tripped on this because of type checking.
472354e
to
a25ca99
Compare
/retest |
/hold for test |
Verification passed with 4.16.0-0.nightly-2024-02-17-094036 + complance-operator from PR #492 code
|
/unhold |
This pr fixes a issue when a profile gets removed from scansettingbinding, the old scan was not deleted when a profile is removed from the existing scansettingbinding, this pr checks that and does the removal so that new scan using that profile can be launch correctly. check OCPBUGS-29272: https://issues.redhat.com/browse/OCPBUGS-29272
52e82a8
to
a146b05
Compare
/retest |
tests/e2e/serial/main_test.go
Outdated
} | ||
return false, nil | ||
} | ||
log.Printf("Scan %s doesn't exist anymore\n", scanName) |
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.
Looking through the logs, it appears we're only asserting that one of the two profiles we removed are actually gone.
We could also assert that ocp4-cis-node
scans are also removed.
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 think the log here was not correct, see https://github.com/ComplianceAsCode/compliance-operator/pull/492/files#diff-fb3ef6051bd7ff7e374c2606632940a81b280739ae4843fa3569f80ef03bdb1aR1618
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.
Mhm - yes. Looks good.
Perhaps we can consolidate the duplicate assertions down to use a loop in a subsequent refactor patch.
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.
let's do that, track in https://issues.redhat.com/browse/CMP-2472
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhmdnd, Vincent056 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 |
@Vincent056: Jira Issue OCPBUGS-29272: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-29272 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
This pr fixes a issue when a profile gets removed from scansettingbinding, the old scan was not deleted when a profile is removed from the existing scansettingbinding, this pr checks that and does the removal so that new scan using that profile can be launch correctly. check OCPBUGS-29272: https://issues.redhat.com/browse/OCPBUGS-29272