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

Bug 2106838

Summary: Operator objects are re-created even after deleting it
Product: OpenShift Container Platform Reporter: jkeister
Component: OLMAssignee: Per da Silva <pegoncal>
OLM sub component: OLM QA Contact: Bruno Andrade <bandrade>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: bandrade, bschmaus, dgautam, hchatter, imm, jclaretm, jiazha, krizza, openshift-bugs-escalate, pegoncal, plarsen, rauferna, s.heijmans, sparpate, tyslaton
Version: 4.7Keywords: FastFix
Target Milestone: ---   
Target Release: 4.10.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2015023 Environment:
Last Closed: 2022-07-25 07:07:10 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: 2015023    
Bug Blocks:    

Comment 2 Jian Zhang 2022-07-14 02:31:08 UTC
1, Create a cluster with the fixed PR via cluster-bot.

mac:~ jianzhang$ oc get clusterversion
NAME      VERSION                                                   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.10.0-0.ci.test-2022-07-14-012127-ci-ln-8d88fgk-latest   True        False         3m24s   Cluster version is 4.10.0-0.ci.test-2022-07-14-012127-ci-ln-8d88fgk-latest

2, subscribe to an operator.

mac:~ jianzhang$ oc get sub -n default
NAME   PACKAGE   SOURCE                CHANNEL
etcd   etcd      community-operators   singlenamespace-alpha
mac:~ jianzhang$ oc get csv -n default
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Succeeded

3, Create an operator resource
mac:~ jianzhang$ oc get etcdcluster -n default
NAME      AGE
example   34s
mac:~ jianzhang$ oc get pods -n default
NAME                             READY   STATUS     RESTARTS   AGE
etcd-operator-74bbd6ff69-hp5lt   3/3     Running    0          111s
example-txqff6xmxl               0/1     Init:0/1   0          42s


4, Uninstall this operator
mac:~ jianzhang$ oc delete csv etcdoperator.v0.9.4 -n default 
clusterserviceversion.operators.coreos.com "etcdoperator.v0.9.4" deleted
mac:~ jianzhang$ oc delete sub etcd   -n default 
subscription.operators.coreos.com "etcd" deleted

5, Delete related CRDs.
mac:~ jianzhang$ oc delete crd etcdclusters.etcd.database.coreos.com etcdrestores.etcd.database.coreos.com  etcdbackups.etcd.database.coreos.com 
customresourcedefinition.apiextensions.k8s.io "etcdclusters.etcd.database.coreos.com" deleted
customresourcedefinition.apiextensions.k8s.io "etcdrestores.etcd.database.coreos.com" deleted
customresourcedefinition.apiextensions.k8s.io "etcdbackups.etcd.database.coreos.com" deleted

6, Delete the `operator` source.
mac:~ jianzhang$ oc get operator
NAME           AGE
etcd.default   94s
mac:~ jianzhang$ oc delete operator etcd.default
operator.operators.coreos.com "etcd.default" deleted

7, check if it is recreated.
mac:~ jianzhang$ oc get operator
No resources found
mac:~ jianzhang$ oc get etcdcluster
Error from server (NotFound): Unable to list "etcd.database.coreos.com/v1beta2, Resource=etcdclusters": the server could not find the requested resource (get etcdclusters.etcd.database.coreos.com)

LGTM, verify it.

Comment 9 errata-xmlrpc 2022-07-25 07:07:10 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 (Important: OpenShift Container Platform 4.10.24 bug fix and security 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/RHSA-2022:5664