Description of problem: Using upstream OLM v0.17.0 on a newly created vanilla kubernetes 1.19.4 kind cluster, I installed the prometheus operator from the upstream community catalog. After uninstalling the prometheus operator (delete subscription, csv, install plans, and crds), I saw the `Operator` object still existing. Running `kubectl delete operator prometheus.default` deleted it, but then OLM immediately recreated it. Before deleting it the first time, it looked like this: ``` apiVersion: operators.coreos.com/v1 kind: Operator metadata: creationTimestamp: "2020-11-19T15:42:06Z" generation: 1 managedFields: - apiVersion: operators.coreos.com/v1 fieldsType: FieldsV1 fieldsV1: f:spec: {} f:status: .: {} f:components: .: {} f:labelSelector: .: {} f:matchExpressions: {} manager: olm operation: Update time: "2020-11-19T15:42:06Z" name: prometheus.default resourceVersion: "4812" selfLink: /apis/operators.coreos.com/v1/operators/prometheus.default uid: b3753ce5-4825-4587-b494-8105b093c901 spec: {} status: components: labelSelector: matchExpressions: - key: operators.coreos.com/prometheus.default operator: Exists ``` After subsequent deletes and OLM re-creations, it looks like this: ``` apiVersion: operators.coreos.com/v1 kind: Operator metadata: creationTimestamp: "2020-11-19T15:42:06Z" generation: 1 managedFields: - apiVersion: operators.coreos.com/v1 fieldsType: FieldsV1 fieldsV1: f:spec: {} f:status: .: {} f:components: .: {} f:labelSelector: .: {} f:matchExpressions: {} manager: olm operation: Update time: "2020-11-19T15:42:06Z" name: prometheus.default resourceVersion: "4812" selfLink: /apis/operators.coreos.com/v1/operators/prometheus.default uid: b3753ce5-4825-4587-b494-8105b093c901 spec: {} ``` Version-Release number of selected component (if applicable): Upstream v0.17.0 How reproducible: Every time I've tried Steps to Reproduce: 1. Start a Kubernetes v1.19.4 cluster 2. Install upstream OLM v0.17.0 3. Create an AllNamespaces operator group 4. Create a subscription for the "prometheus" operator from the "operatorhubio-catalog" source 5. Wait for the operator to be installed successfully 6. Delete the subscription, CSV, and CRDs associated with the prometheus operator 7. Delete Operator object associated with the prometheus operator Actual results: Run `kubectl get operators` and see that OLM re-created the just deleted prometheus Operator object. Expected results: Run `kubectl get operators` and see no Operator object for prometheus Additional info:
Looks like this one won't make it in for the 4.7 release, the work is still under review for now. Moving it out and marking for upcoming sprint.
*** Bug 1923854 has been marked as a duplicate of this bug. ***
*** Bug 1928079 has been marked as a duplicate of this bug. ***
Hi! any workaround available for OCP 4.6.1X ? thx
To workaround this issue, run the following: ``` kubectl scale deployment -n openshift-operator-lifecycle-manager olm-operator --replicas=0 kubectl delete operator -n <your-operator-namespace> <your-operator> kubectl scale deployment -n openshift-operator-lifecycle-manager olm-operator --replicas=1 ```
verify it on 4.7. LGTM -- [root@preserve-olm-env bin]# oc get pod -n openshift-operator-lifecycle-manager NAME READY STATUS RESTARTS AGE catalog-operator-7fd8476f47-c7tkv 1/1 Running 0 16m olm-operator-6fc884bdc9-nbcdx 1/1 Running 0 14m packageserver-6fc885578d-pzq2m 1/1 Running 0 14m packageserver-6fc885578d-qmr99 1/1 Running 0 16m [root@preserve-olm-env bin]# oc exec catalog-operator-7fd8476f47-c7tkv -n openshift-operator-lifecycle-manager -- olm --version OLM version: 0.17.0 git commit: 4b67acc560a790caa37fdff2f2c1a1eb50a4949f [root@preserve-olm-env bin]# [root@preserve-olm-env 1899588]# cat og-single.yaml kind: OperatorGroup apiVersion: operators.coreos.com/v1 metadata: name: og-single1 namespace: default spec: targetNamespaces: - default [root@preserve-olm-env 1899588]# oc apply -f og-single.yaml operatorgroup.operators.coreos.com/og-single1 created [root@preserve-olm-env 1899588]# cat teiidcatsrc.yaml apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: teiid namespace: default spec: displayName: "teiid Operators" image: quay.io/kuiwang/teiid-index:1898500 publisher: QE sourceType: grpc [root@preserve-olm-env 1899588]# oc apply -f teiidcatsrc.yaml catalogsource.operators.coreos.com/teiid created [root@preserve-olm-env 1899588]# cat teiidsub.yaml apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: teiid namespace: default spec: source: teiid sourceNamespace: default channel: alpha installPlanApproval: Automatic name: teiid [root@preserve-olm-env 1899588]# oc apply -f teiidsub.yaml subscription.operators.coreos.com/teiid created [root@preserve-olm-env 1899588]# [root@preserve-olm-env 1899588]# oc get sub NAME PACKAGE SOURCE CHANNEL teiid teiid teiid alpha [root@preserve-olm-env 1899588]# oc get ip NAME CSV APPROVAL APPROVED install-d9zb5 teiid.v0.3.0 Automatic true [root@preserve-olm-env 1899588]# oc get csv NAME DISPLAY VERSION REPLACES PHASE teiid.v0.3.0 Teiid 0.3.0 Installing [root@preserve-olm-env 1899588]# oc get csv NAME DISPLAY VERSION REPLACES PHASE teiid.v0.3.0 Teiid 0.3.0 Succeeded [root@preserve-olm-env 1899588]# oc get operators NAME AGE teiid.default 89s [root@preserve-olm-env 1899588]# [root@preserve-olm-env 1899588]# oc delete sub teiid subscription.operators.coreos.com "teiid" deleted [root@preserve-olm-env 1899588]# oc delete csv teiid.v0.3.0 clusterserviceversion.operators.coreos.com "teiid.v0.3.0" deleted [root@preserve-olm-env 1899588]# [root@preserve-olm-env 1899588]# oc get operator teiid.default -o yaml apiVersion: operators.coreos.com/v1 kind: Operator metadata: ... name: teiid.default resourceVersion: "40657" selfLink: /apis/operators.coreos.com/v1/operators/teiid.default uid: 57a42948-8349-4817-af41-2506a18282f4 spec: {} status: components: labelSelector: matchExpressions: - key: operators.coreos.com/teiid.default operator: Exists refs: - apiVersion: apiextensions.k8s.io/v1 conditions: - lastTransitionTime: "2021-02-19T02:16:50Z" message: no conflicts found reason: NoConflicts status: "True" type: NamesAccepted - lastTransitionTime: "2021-02-19T02:16:50Z" message: the initial names have been accepted reason: InitialNamesAccepted status: "True" type: Established - lastTransitionTime: "2021-02-19T02:16:50Z" message: 'spec.preserveUnknownFields: Invalid value: true: must be false' reason: Violations status: "True" type: NonStructuralSchema kind: CustomResourceDefinition name: virtualdatabases.teiid.io [root@preserve-olm-env 1899588]# [root@preserve-olm-env 1899588]# oc delete crd virtualdatabases.teiid.io customresourcedefinition.apiextensions.k8s.io "virtualdatabases.teiid.io" deleted [root@preserve-olm-env 1899588]# oc get operator teiid.default -o yaml apiVersion: operators.coreos.com/v1 kind: Operator metadata: ... name: teiid.default resourceVersion: "40979" selfLink: /apis/operators.coreos.com/v1/operators/teiid.default uid: 57a42948-8349-4817-af41-2506a18282f4 spec: {} status: components: labelSelector: matchExpressions: - key: operators.coreos.com/teiid.default operator: Exists [root@preserve-olm-env 1899588]# [root@preserve-olm-env 1899588]# oc delete operator teiid.default operator.operators.coreos.com "teiid.default" deleted [root@preserve-olm-env 1899588]# oc get operator teiid.default -o yaml Error from server (NotFound): operators.operators.coreos.com "teiid.default" not found --
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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement 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-2020:5633
I have experienced the same problem using a different platform. What was the workaround for fixing this problem on the opernshift platform?
In case anyone else references this bug, please review this documentation [0] which details: - why the prometheus operator continues to appear in the `oc get operators` output. - How to fully remove the operator. Ref [0] https://github.com/operator-framework/olm-docs/pull/251/files