-
Notifications
You must be signed in to change notification settings - Fork 29
CMP-3156: Simplify similar cases in ComplianceScan pending phase #693
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
base: master
Are you sure you want to change the base?
Conversation
@rhmdnd: This pull request references CMP-3156 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.19.0" version, but no target version was set. 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. |
@@ -285,7 +285,7 @@ func (r *ReconcileComplianceScan) validate(instance *compv1alpha1.ComplianceScan | |||
func (r *ReconcileComplianceScan) phasePendingHandler(instance *compv1alpha1.ComplianceScan, logger logr.Logger) (reconcile.Result, error) { | |||
logger.Info("Phase: Pending") | |||
// Remove annotation if needed | |||
if instance.NeedsRescan() { | |||
if instance.NeedsRescan() || instance.NeedsTimeoutRescan() { |
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.
Should be able to add a test for this in https://github.com/ComplianceAsCode/compliance-operator/blob/master/pkg/controller/compliancescan/compliancescan_controller_test.go
🤖 To deploy this PR, run the following command:
|
🤖 To deploy this PR, run the following command:
|
🤖 To deploy this PR, run the following command:
|
/jira refresh |
@rhmdnd: This pull request references CMP-3156 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.19.0" version, but no target version was set. 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. |
🤖 To deploy this PR, run the following command:
|
/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 |
/test e2e-aws-serial |
/jira refresh |
@rhmdnd: This pull request references CMP-3156 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.19.0" version, but no target version was set. 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. |
We need to remove annotations when rerunning a scan, regardless of it being rerun for a timeout or a rescan. We handled these cases separately, but didn't need to since we're using `delete()`, which performs a no-op if the annotation doesn't exist. This PR simplifies the code by reducing both conditionals into a single case.
New changes are detected. LGTM label has been removed. |
🤖 To deploy this PR, run the following command:
|
Seeing the following crop up in tests:
|
/retest-required |
Applying additional labels since this is only removing duplicate code |
We need to remove annotations when rerunning a scan, regardless of it
being rerun for a timeout or a rescan. We handled these cases
separately, but didn't need to since we're using
delete()
, whichperforms a no-op if the annotation doesn't exist.
This PR simplifies the code by reducing both conditionals into a single
case.