Bug 1908990 - The profile parser pod deployment and associated profiles should get removed after upgrade the compliance operator
Summary: The profile parser pod deployment and associated profiles should get removed ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Compliance Operator
Version: 4.6.z
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.7.0
Assignee: Jakub Hrozek
QA Contact: Prashant Dhamdhere
URL:
Whiteboard:
Depends On: 1905008
Blocks: 1908991
TreeView+ depends on / blocked
 
Reported: 2020-12-18 06:10 UTC by xiyuan
Modified: 2021-02-24 19:46 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1908991 (view as bug list)
Environment:
Last Closed: 2021-02-24 19:45:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift compliance-operator pull 534 0 None closed Bug 1908990: Remove non-namespaced deployments 2021-01-25 07:30:00 UTC
Red Hat Product Errata RHBA-2021:0435 0 None None None 2021-02-24 19:46:07 UTC

Description xiyuan 2020-12-18 06:10:29 UTC
Description of problem:
The profile parser pod deployment and associated profiles should get removed after upgrade the compliance operator to latest version

Version-Release number of selected component (if applicable):
4.6.9

How reproducible:
Always

Steps to Reproduce:
1. on stage cluster, install a compliance operator:
$oc create -f - <<EOF    
apiVersion: v1                          
kind: Namespace
metadata:
  name: up                        
  annotations:                    
    openshift.io/node-selector: ""
EOF                            
 
$ oc create -f - <<EOF    
apiVersion: operators.coreos.com/v1      
kind: OperatorGroup
metadata:
   name: openshift-compliance-abcd
   namespace: up                  
spec:                            
   targetNamespaces:                          
   - up
EOF
 
$ oc create -f - <<EOF    
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
   name: openshift-compliance-operator
   namespace: up                  
spec:                            
   channel: "4.6"                          
   Approval: Manual
   name: compliance-operator
   source: redhat-operators
   sourceNamespace: openshift-marketplace
EOF
 
$ oc get ip
NAME            CSV                           APPROVAL    APPROVED
install-xbqh7   compliance-operator.v0.1.17   Automatic   true
 
 
$ oc get csv -w
NAME                                           DISPLAY                  VERSION                 REPLACES   PHASE
compliance-operator.v0.1.17                    Compliance Operator      0.1.17                             Succeeded
elasticsearch-operator.4.6.0-202012050130.p0   Elasticsearch Operator   4.6.0-202012050130.p0              Succeeded

2. patch source in subscriptions which will have stage index image with latest version of operator:
$ oc patch subscriptions openshift-compliance-operator -p '{"spec":{"source":"qe-app-registry"}}' --type='merge'

3. check the ip and csv to makre sure operator upgrade finished:
$ oc get ip
NAME            CSV                           APPROVAL    APPROVED
install-cx59m   compliance-operator.v0.1.22   Automatic   true
install-xbqh7   compliance-operator.v0.1.17   Automatic   true
$ oc get csv
NAME                                           DISPLAY                  VERSION                 REPLACES                      PHASE
compliance-operator.v0.1.22                    Compliance Operator      0.1.22                  compliance-operator.v0.1.17   Succeeded
elasticsearch-operator.4.6.0-202012050130.p0   Elasticsearch Operator   4.6.0-202012050130.p0                                 Succeeded

Actual results:
The profile parser pod deployment and associated profiles does not get removed after upgrade the compliance operator to latest version

############Before upgrade, there are deployments for profiles:
oc get deployment
NAME                 READY  UP-TO-DATE  AVAILABLE  AGE
compliance-operator  1/1    1           1          5m
ocp4-pp              1/1    1           1          4m
rhcos4-pp            1/1    1           1          4m


############After upgrade, there are two new deployments for profile parser:
$ oc get deployment
NAME                  READY   UP-TO-DATE   AVAILABLE   AGE
compliance-operator   1/1     1            1           15m
ocp4-pp               1/1     1            1           14m
ocp4-up-pp            1/1     1            1           3m43s
rhcos4-pp             1/1     1            1           14m
rhcos4-up-pp          1/1     1            1           3m43s
$ oc get pod
NAME                                   READY   STATUS    RESTARTS   AGE
compliance-operator-84c495768b-zsgqb   1/1     Running   0          4m36s
ocp4-pp-5bbc8cb8db-4xdkg               1/1     Running   0          14m
ocp4-up-pp-bb856cb95-8n6sd             1/1     Running   0          3m37s
rhcos4-pp-6f5fdfbdb-wqwxv              1/1     Running   0          14m
rhcos4-up-pp-f84f7559-m7vfh            1/1     Running   0          3m37s
$ oc get profile.compliance
NAME              AGE
ocp4-cis          18m
ocp4-cis-node     18m
ocp4-e8           18m
ocp4-moderate     18m
ocp4-ncp          18m
rhcos4-e8         17m
rhcos4-moderate   17m
rhcos4-ncp        17m

$ oc delete deployment ocp4-pp rhcos4-pp
deployment.apps "ocp4-pp" deleted
deployment.apps "rhcos4-pp" deleted
$ oc get pod
NAME                                   READY   STATUS    RESTARTS   AGE
compliance-operator-84c495768b-zsgqb   1/1     Running   0          9m31s
ocp4-up-pp-bb856cb95-8n6sd             1/1     Running   0          8m32s
rhcos4-up-pp-f84f7559-m7vfh            1/1     Running   0          8m32s

Expected results
The profile parser pod deployment and associated profiles should get removed after upgrade the compliance operator to latest version


Additional info
Delete  deployment manually doesn't work. The ocp profiles still exist. 
$ oc get profile.compliance
NAME              AGE
ocp4-cis          18m
ocp4-cis-node     18m
ocp4-e8           18m
ocp4-moderate     18m
ocp4-ncp          18m
rhcos4-e8         18m
rhcos4-moderate   18m
rhcos4-ncp        18m

Comment 3 xiyuan 2020-12-23 09:45:12 UTC
new bundle image needed to verify this bug.

Comment 10 errata-xmlrpc 2021-02-24 19:45:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.7 compliance-operator image update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:0435


Note You need to log in before you can comment on or make changes to this bug.