Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1797021

Summary: ClusterServiceVersion resource with Deleting status is never removed
Product: OpenShift Container Platform Reporter: Evan Cordell <ecordell>
Component: OLMAssignee: Evan Cordell <ecordell>
OLM sub component: OLM QA Contact: Salvatore Colangelo <scolange>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: bandrade, dmoessne, jiazha, lstanton, nhale, scuppett
Version: 4.2.0   
Target Milestone: ---   
Target Release: 4.2.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1797019 Environment:
Last Closed: 2020-04-07 17:34:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1797019    
Bug Blocks:    

Comment 4 Salvatore Colangelo 2020-03-27 17:51:01 UTC
Hi,
  below the steps

[scolange@scolange olm]$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.2.0-0.nightly-2020-03-26-121826   True        False         4h7m    Cluster version is 4.2.0-0.nightly-2020-03-26-121826

[scolange@scolange olm]$ oc exec catalog-operator-f8d596b6c-hgmvl -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.11.0
git commit: 35a677d93fa2b2769f7cbb3fb88c3e9b4e8bd8cfll


Step 1 : Create namespace openshift-operators-redhat

oc create ns  openshift-operators-redhat


Step 2 :  create operatorGroup in that namespace

[scolange@scolange BUG-1797019]$ cat og.yaml 
apiVersion: v1
items:
- apiVersion: operators.coreos.com/v1
  kind: OperatorGroup
  metadata:
    annotations:
      olm.providedAPIs: Elasticsearch.v1.logging.openshift.io
    creationTimestamp: "2020-02-05T08:23:46Z"
    generation: 1
    name: openshift-operators-redhat
    namespace: openshift-operators-redhat
    resourceVersion: "68155"
    selfLink: /apis/operators.coreos.com/v1/namespaces/openshift-operators-redhat/operatorgroups/openshift-operators-redhat
    uid: c3b55bb5-4545-4232-a8cb-afad8b1c8792
  spec: {}
  status:
    lastUpdated: "2020-02-05T08:23:46Z"
    namespaces:
    - ""
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

[scolange@scolange BUG-1797019]$ oc get operatorgroup -n openshift-operators-redhat
NAME                         AGE
openshift-operators-redhat   1m


Step 3: create subscription in that namespace

[scolange@scolange BUG-1797019]$ cat sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: elasticsearch-operator
  namespace: openshift-operators-redhat
spec:
   channel: "4.3"
   installPlanApproval: Automatic
   name: elasticsearch-operator
   source: redhat-operators
   sourceNamespace: openshift-marketplace


[scolange@scolange BUG-1797019]$ oc get sub -n openshift-operators-redhat
NAME                     PACKAGE                  SOURCE             CHANNEL
elasticsearch-operator   elasticsearch-operator   redhat-operators   4.2

[scolange@scolange BUG-1797019]$ oc get csv -n openshift-operators-redhat
NAME                                         DISPLAY                  VERSION               REPLACES   PHASE
elasticsearch-operator.4.2.23-202003090920   Elasticsearch Operator   4.2.23-202003090920              Succeeded

[scolange@scolange BUG-1797019]$ oc get ip -n openshift-operators-redhat
NAME            CSV                                          APPROVAL    APPROVED
install-4z6sg   elasticsearch-operator.4.2.23-202003090920   Automatic   true


Step 4: Check the copied CSV in the openshift-operators namespace, and then check the annotation.olm.operatorGroup field


[scolange@scolange BUG-1797019]$ oc get csv elasticsearch-operator.4.2.23-202003090920 -n openshift-operators -o yaml
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
.....
.....
    olm.operatorGroup: openshift-operators-redhat
    olm.operatorNamespace: openshift-operators-redhat
    olm.skipRange: '>=4.1.0 <4.2.23-202003090920'
    support: AOS Cluster Logging, Jaeger
  creationTimestamp: "2020-03-27T17:43:45Z"
  generation: 1
  labels:
    olm.api.e43efcaa45c9f8d0: provided
    olm.copiedFrom: openshift-operators-redhat
  name: elasticsearch-operator.4.2.23-202003090920
  namespace: openshift-operators


[scolange@scolange BUG-1797019]$ oc get operatorgroup -n openshift-operators
NAME               AGE
global-operators   6h7m


The name is different from csv copied it's correct 


[scolange@scolange BUG-1797019]$ oc delete sub elasticsearch-operator -n openshift-operators-redhat
subscription.operators.coreos.com "elasticsearch-operator" deleted

[scolange@scolange BUG-1797019]$ oc delete csv elasticsearch-operator.4.2.23-202003090920 -n openshift-operators-redhat
clusterserviceversion.operators.coreos.com "elasticsearch-operator.4.2.23-202003090920" deleted

[scolange@scolange BUG-1797019]$ oc get csv -A
NAMESPACE                              NAME            DISPLAY          VERSION   REPLACES   PHASE
openshift-operator-lifecycle-manager   packageserver   Package Server   0.11.0               Succeeded


All csv copied are deleted! LGMT

Comment 6 errata-xmlrpc 2020-04-07 17:34:03 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, 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-2020:1263