Bug 2113991

Summary: When debug is setting to true, the pod generated by ComplianceSuite won’t get deleted when the ComplianceSuite get deleted
Product: OpenShift Container Platform Reporter: Varad Ahirwadkar <vahirwad>
Component: Compliance OperatorAssignee: Jakub Hrozek <jhrozek>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.11CC: lbragsta, mrogers, wenshen, xiyuan
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-02 15:03:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Varad Ahirwadkar 2022-08-02 13:56:51 UTC
Description of problem:
Pods generated by ComplianceSuite not getting deleted automatically after deleting ComplianceSuite resource with debug: true

Version-Release number of selected component (if applicable):
compliance-operator.v0.1.53
OCP release: 4.11.0-rc.6
Architecture: ppc64le

How reproducible:
Everytime

Steps to Reproduce:
1. Install Compliance Operator

2. Create ComplianceSuite

# oc create -f - <<EOF
apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceSuite
metadata:
  name: example-compliancesuite
spec:
  scans:
    - name: rhcos-scan
      profile: xccdf_org.ssgproject.content_profile_moderate
      content: ssg-rhcos4-ds.xml
      contentImage: quay.io/complianceascode/ocp4:latest
      rule: "xccdf_org.ssgproject.content_rule_no_netrc_files"
      debug: true
      scanTolerations:
        - effect: NoSchedule
          key: key1
          value: value1
          operator: Equal
      nodeSelector:
        node-role.kubernetes.io/worker: ""
EOF
compliancesuite.compliance.openshift.io/example-compliancesuite created

# oc get pods
NAME                                                          READY   STATUS      RESTARTS      AGE
aggregator-pod-rhcos-scan                                     0/1     Completed   0             2m40s
compliance-operator-6699bb9bb7-nlc7p                          1/1     Running     1 (63m ago)   64m
ocp4-openshift-compliance-pp-55647cf5d7-bpl6n                 1/1     Running     0             62m
rhcos-scan-tor01-worker-0.rdr-varad-ocp-410-upi.ibm.com-pod   0/2     Completed   0             4m30s
rhcos-scan-tor01-worker-1.rdr-varad-ocp-410-upi.ibm.com-pod   0/2     Completed   0             4m30s
rhcos-scan-tor01-worker-2.rdr-varad-ocp-410-upi.ibm.com-pod   0/2     Completed   0             4m30s
rhcos4-openshift-compliance-pp-598cc46495-zb6mj               1/1     Running     0             62m

3. Delete the compliancesuite
# oc delete compliancesuite example-compliancesuite
compliancesuite.compliance.openshift.io "example-compliancesuite" deleted


Actual results:
The pods generated by ComplianceSuite example-compliancesuite won’t be deleted when the ComplianceSuite example-compliancesuite get deleted

# oc get pods
NAME                                                          READY   STATUS      RESTARTS      AGE
aggregator-pod-rhcos-scan                                     0/1     Completed   0             7m19s
compliance-operator-6699bb9bb7-nlc7p                          1/1     Running     1 (68m ago)   69m
ocp4-openshift-compliance-pp-55647cf5d7-bpl6n                 1/1     Running     0             67m
rhcos-scan-tor01-worker-0.rdr-varad-ocp-410-upi.ibm.com-pod   0/2     Completed   0             9m9s
rhcos-scan-tor01-worker-1.rdr-varad-ocp-410-upi.ibm.com-pod   0/2     Completed   0             9m9s
rhcos-scan-tor01-worker-2.rdr-varad-ocp-410-upi.ibm.com-pod   0/2     Completed   0             9m9s
rhcos4-openshift-compliance-pp-598cc46495-zb6mj               1/1     Running     0             67m



Expected results:
All pods generated by compliance suite should be deleted when the compliancesuite example-compliancesuite get deleted

Additional info:
Must gather logs: https://drive.google.com/file/d/1hJ5_3rZr3Vma94Nf9bF8EkgKhriq4fi_/view?usp=sharing

Comment 1 Jakub Hrozek 2022-08-02 15:03:47 UTC

*** This bug has been marked as a duplicate of bug 2092913 ***