compliance-operator icon indicating copy to clipboard operation
compliance-operator copied to clipboard

CMP-3969: Fix panic issue when deleting a scan with invalid storage size

Open xiaojiey opened this issue 1 month ago • 9 comments

Fix panic issue when deleting a scan with invalid storage size

xiaojiey avatar Nov 24 '25 05:11 xiaojiey

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xiaojiey

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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Nov 24 '25 05:11 openshift-ci[bot]

@xiaojiey: This pull request references CMP-3969 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 bug to target the "4.21.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.

openshift-ci-robot avatar Nov 24 '25 05:11 openshift-ci-robot

:robot: To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:993-6726366a502651447d386fee3a4c736d2a667620

github-actions[bot] avatar Nov 24 '25 05:11 github-actions[bot]

:robot: To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:993-15a3b2064bfb20c8b8594d44cb6ac44a83783052

github-actions[bot] avatar Nov 24 '25 06:11 github-actions[bot]

:robot: To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:993-fae2907259dbdee5003230202ba834592baf2f64

github-actions[bot] avatar Nov 24 '25 06:11 github-actions[bot]

:robot: To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:993-465530e6110de5756d848de6b5d06684de764a71

github-actions[bot] avatar Nov 24 '25 06:11 github-actions[bot]

Pre-merge verificartion PASS with CO installed from this PR + OCP 4.20:

Test case OCP-43072 run on the cluster without the defer step. Compliancesuite is created directly in this test case. Following compliancesuite was created:

apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceSuite
metadata:
  name: worker-compliancesuiteubsh8thrl0
  namespace: openshift-compliance
spec:
  autoApplyRemediations: false
  scans:
    - name: worker-scanihr5afxz13 
      profile: xccdf_org.ssgproject.content_profile_coreos-ncp
      scanType: Node  
      content: ssg-rhcos4-ds.xml
      contentImage: relatedImageProfile
      nodeSelector: 
        node-role.kubernetes.io/worker: ""
      rawResultStorage:
        nodeSelector:
          node-role.kubernetes.io/master: ""
        size: 1B
        tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
          operator: Exists
        - effect: NoExecute
          key: node.kubernetes.io/not-ready
          operator: Exists
          tolerationSeconds: 300
        - effect: NoExecute
          key: node.kubernetes.io/unreachable
          operator: Exists
          tolerationSeconds: 300
        - effect: NoSchedule
          key: node.kubernetes.io/memory-pressure
          operator: Exists

Compliance suite and scan resulted in Error, which is expected and after got deleted successfully:

$ oc get suite
NAME                               PHASE   RESULT
worker-compliancesuiteubsh8thrl0   DONE    ERROR

$ oc get scan
NAME                    PHASE   RESULT
worker-scanihr5afxz13   DONE    ERROR

$ oc delete suite worker-compliancesuiteubsh8thrl0 
compliancesuite.compliance.openshift.io "worker-compliancesuiteubsh8thrl0" deleted

$ oc get scan
No resources found in openshift-compliance namespace.

$ oc get suite
No resources found in openshift-compliance namespace.

Anna-Koudelkova avatar Nov 24 '25 15:11 Anna-Koudelkova

/retest-required

xiaojiey avatar Nov 25 '25 08:11 xiaojiey

@xiaojiey: This pull request references CMP-3969 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 bug to target the "4.21.0" version, but no target version was set.

This pull request references CMP-3829 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 story to target the "4.21.0" version, but no target version was set.

In response to this:

Fix panic issue when deleting a scan with invalid storage size

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.

openshift-ci-robot avatar Dec 02 '25 09:12 openshift-ci-robot

:robot: To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:993-4051ff52b1f50460f3766b9ced328e3c4abb6be0

github-actions[bot] avatar Dec 02 '25 09:12 github-actions[bot]

:robot: To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:993-8f80c028bdb5990bcccb7dba2ad4e19fae0afe9b

github-actions[bot] avatar Dec 02 '25 13:12 github-actions[bot]

/retest

xiaojiey avatar Dec 03 '25 06:12 xiaojiey

:robot: To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:993-5b5c80a5496e0fa09542014a4dd0341a36095ebe

github-actions[bot] avatar Dec 05 '25 02:12 github-actions[bot]

/retest

xiaojiey avatar Dec 05 '25 04:12 xiaojiey

/retest-required

xiaojiey avatar Dec 09 '25 08:12 xiaojiey

/retest

xiaojiey avatar Dec 09 '25 08:12 xiaojiey

@xiaojiey: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-serial 5b5c80a5496e0fa09542014a4dd0341a36095ebe link true /test e2e-aws-serial
ci/prow/e2e-rosa 5b5c80a5496e0fa09542014a4dd0341a36095ebe link true /test e2e-rosa

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

openshift-ci[bot] avatar Dec 09 '25 09:12 openshift-ci[bot]