Bug 1906134 - OLM should not create OperatorConditions for copied CSVs
Summary: OLM should not create OperatorConditions for copied CSVs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.7.0
Assignee: Alexander Greene
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-09 17:51 UTC by Alexander Greene
Modified: 2021-02-24 15:42 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: OLM was creating an OperatorCondition for each copied CSVs. A copied CSV is used to denote that an operator is available in a namespace, not that the operator is deployed in the namespace. Operator Conditions should only be created for non-copied CSVs. Consequence: The controller responsible for reconciling OperatorConditions reported numerous issues since it was reconciling an OperatorCondition created for a copied CSV rather than a non-copied CSV. Fix: OLM no longer creates OperatorConditions for copied CSVs. Result: OperatorConditions are only generated for non-copied CSVs allowing the controller to behave as expected.
Clone Of:
Environment:
Last Closed: 2021-02-24 15:41:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-lifecycle-manager pull 1899 0 None closed Bug 1906134: Don't create OperatorConditions for copied CSVs 2021-02-08 13:21:33 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:42:08 UTC

Description Alexander Greene 2020-12-09 17:51:16 UTC
Description of problem:
OLM recently introduced a new controller which generates an OperatorCondition for all CSVs. This controller does not exclude copied CSVs which it should.

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

How reproducible:
Always

Steps to Reproduce:
1. Apply the following yaml:
cat radanalytics-spark.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata: 
  name: my-radanalytics-spark
  namespace: operators
spec:
  channel: alpha 
  name: radanalytics-spark
  source: operatorhubio-catalog
  sourceNamespace: olm


Actual results:
1. An OperatorCondition is created in every namespace that a copied CSV is in
$ oc get operatorconditions --all-namespaces
NAMESPACE         NAME                   AGE
default           sparkoperator.v1.0.2   33s
kube-node-lease   sparkoperator.v1.0.2   34s
kube-public       sparkoperator.v1.0.2   35s
kube-system       sparkoperator.v1.0.2   35s
olm               packageserver          2m14s
olm               sparkoperator.v1.0.2   32s
operators         sparkoperator.v1.0.2   36s

Expected results:
1. The OperatorCondition is only created in the operators ns for the radanalytics-spark operator
$ oc get operatorconditions --all-namespaces
NAMESPACE         NAME                   AGE
olm               packageserver          2m14s
operators         sparkoperator.v1.0.2   36s

Additional info:

Comment 2 Jian Zhang 2020-12-14 07:26:14 UTC
Cluster version is 4.7.0-0.nightly-2020-12-13-224840
[root@preserve-olm-env data]# oc -n openshift-operator-lifecycle-manager exec catalog-operator-66ccb94685-cpfqj -- olm --version
OLM version: 0.17.0
git commit: 4b66803055a8ab611447c33ed86e755ad39cb313


1, Install a cluster scoped operator, 
[root@preserve-olm-env data]# oc get sub -n openshift-operators
NAME   PACKAGE   SOURCE                CHANNEL
etcd   etcd      community-operators   clusterwide-alpha
[root@preserve-olm-env data]# oc get csv -n openshift-operators
NAME                              DISPLAY   VERSION             REPLACES                          PHASE
etcdoperator.v0.9.4-clusterwide   etcd      0.9.4-clusterwide   etcdoperator.v0.9.2-clusterwide   Succeeded

2, Check if the OperatorConditon generated for the copied csv.

[root@preserve-olm-env data]# oc get operatorcondition -A
NAMESPACE                              NAME                              AGE
openshift-operator-lifecycle-manager   packageserver                     46m
openshift-operators                    etcdoperator.v0.9.4-clusterwide   11m

[root@preserve-olm-env data]# oc get csv -n default
NAME                              DISPLAY   VERSION             REPLACES                          PHASE
etcdoperator.v0.9.4-clusterwide   etcd      0.9.4-clusterwide   etcdoperator.v0.9.2-clusterwide   Succeeded

[root@preserve-olm-env data]# oc get operatorcondition -n default
No resources found in default namespace.

No OperatorCondtion generated for the copied CSV. LGTM, verify it.

Comment 5 errata-xmlrpc 2021-02-24 15:41:51 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 (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


Note You need to log in before you can comment on or make changes to this bug.