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

Bug 1906134

Summary: OLM should not create OperatorConditions for copied CSVs
Product: OpenShift Container Platform Reporter: Alexander Greene <agreene>
Component: OLMAssignee: Alexander Greene <agreene>
OLM sub component: OLM QA Contact: Jian Zhang <jiazha>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high    
Version: 4.7   
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:41:51 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 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