Bug 1928079

Summary: [OCP 4.6.1X] Unable to delete operator
Product: OpenShift Container Platform Reporter: Xavier Morano <xmorano>
Component: OLMAssignee: Kevin Rizza <krizza>
OLM sub component: OperatorHub QA Contact: Jian Zhang <jiazha>
Status: CLOSED DUPLICATE Docs Contact:
Severity: medium    
Priority: medium CC: anbhatta, rdiazgav
Version: 4.6   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-12 17:16:18 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 Xavier Morano 2021-02-12 10:51:13 UTC
Description of problem:
after removing CSV, the operator disappears from the web console but not from ocp cli, even after deleting it

Version-Release number of selected component (if applicable):
ocp 4.6.12 - 16

How reproducible:

Always

Steps to Reproduce:

1) install crossplane operator from web console
2) delete the operator
   1) Check the current version of the subscribed Operator (for example, crossplane) in the currentCSV file
       $ oc get subscription crossplane -n openshift-operators -o yaml | grep currentCSV
       currentCSV: crossplane.v0.11.0

   2) Delete the subscription (for example, crossplane):
      $ oc delete subscription crossplane -n openshift-operators
      subscription.operators.coreos.com "crossplane" deleted

   3) Delete the CSV for the Operator in the target namespace using the currentCSV value from the previous step:
      $ oc delete clusterserviceversion crossplane.v0.11.0 -n openshift-operators
      clusterserviceversion.operators.coreos.com "crossplane.v0.11.0" deleted

  Here, the operator disappear from web console

3) delete the operator
   1) $ oc delete operators crossplane.openshift-operators
      operator.operators.coreos.com "crossplane.openshift-operators" deleted

   but it's recreated

   $ oc get operators | grep crossplane
   crossplane.openshift-operators                        7s


Actual results:
the operator is re-created

Expected results:
The operator is deleted

Additional info:

Comment 1 Anik 2021-02-12 15:38:53 UTC
Looks like the operator pod is getting deleted (since deleting the CSV removes the CSV and it doesn't show up in the console again), but the metadata persists in the operator API. Needs to be reproduced to be confirmed.

Comment 2 Kevin Rizza 2021-02-12 17:16:18 UTC
This appears to be a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1899588

I'm closing this as a duplicate.

Also, for your information in the future, the Operator API also tracks other related resources besides the CSV and Subscription -- the common resources that not all users are aware of are that you need to also delete the CRD for the Operator resource to be removed successfully once the bug I mentioned above is resolved.

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