Bug 1923854

Summary: Uninstalled operator keeps showing in the result of oc get operator command
Product: OpenShift Container Platform Reporter: yhe
Component: OLMAssignee: Evan Cordell <ecordell>
OLM sub component: OperatorHub QA Contact: Jian Zhang <jiazha>
Status: CLOSED DUPLICATE Docs Contact:
Severity: medium    
Priority: unspecified CC: krizza, nhale
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-02 20:43:17 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 yhe 2021-02-02 05:28:34 UTC
Description of problem:
After uninstalling an operator from the OperatorHub GUI, the corresponding subscription and csv are deleted.
However, the operator keeps showing in the result of the oc get operator command.

$ oc get subscription -A
No resources found

$ oc get csv -A
NAMESPACE                              NAME            DISPLAY          VERSION   REPLACES   PHASE
openshift-operator-lifecycle-manager   packageserver   Package Server   0.17.0               Succeeded

$ oc get operator
NAME                                                AGE
elasticsearch-operator.openshift-operators-redhat   127m

$ oc delete operator elasticsearch-operator.openshift-operators-redhat
operator.operators.coreos.com "elasticsearch-operator.openshift-operators-redhat" deleted

$ oc get operator
NAME                                                AGE
elasticsearch-operator.openshift-operators-redhat   2s

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


How reproducible:
Always

Steps to Reproduce:
1. Install an operator from the OperatorHub, e.g. Elasticsearch Operator
2. Uninstall the operator from the OperatorHub
3. Check the result of the oc get operator command

Actual results:
The uninstalled operator shows up

Expected results:
The uninstalled operator doesn't show up

Additional info:

Comment 1 Kevin Rizza 2021-02-02 20:43:17 UTC
Hello,

This is because using the uninstallation button on the OpenShift console does not completely remove any trace of the Operator installation. Specifically, it will not remove the CRDs or any CRs associated with the operator. If you `oc get elasticsearch-operator.openshift-operators-redhat -o yaml` there should be a place in the status block that describes the set of resources that the Operator object represents. In order to remove that object you will need to ensure all associated resources are removed in order to delete the Operator, and the console does not provide a function like that.

I'm closing this as NOTABUG. If you have further questions, feel free to reach out on the CoreOS slack channel #forum-operator-fw or on the olm dev mailing list aos-odin