Bug 1815762

Summary: Fails to install from bundle images
Product: OpenShift Container Platform Reporter: Evan Cordell <ecordell>
Component: OLMAssignee: Evan Cordell <ecordell>
OLM sub component: OLM QA Contact: Jian Zhang <jiazha>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: jiazha
Version: 4.5   
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1815761 Environment:
Last Closed: 2020-05-13 22:01:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1815761    
Bug Blocks:    

Description Evan Cordell 2020-03-21 13:38:18 UTC
+++ This bug was initially created as a clone of Bug #1815761 +++

Description of problem:

Bundle images were not surfacing the CSV name to the installplan, so those bundles were missing from the clusterServiceVersionNames field. That is used when applying an installplan to decide whether to emit errors like "pre-existing CRD owners found for owned CRD(s) of dependent CSV."


How reproducible: Always


Steps to Reproduce:
1. Create a bundle image
2. Create an index image referencing the bundle image
3. Create a CatalogSource that references the index image
4. Create a subscription to the catalog that will install the bundle image

Actual results:

InstallPlan has an error: "pre-existing CRD owners found for owned CRD(s) of dependent CSV."

Expected results: 

Bundle installs


Additional info:

https://github.com/operator-framework/operator-lifecycle-manager/issues/1347

Comment 3 Jian Zhang 2020-04-02 03:36:00 UTC
mac:~ jianzhang$ oc adm release info registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-04-01-213929 --commits |grep lifecycle
  operator-lifecycle-manager                     https://github.com/operator-framework/operator-lifecycle-manager            3f7675c6867e4d43c99eb8138cfb5fc686a37b3b

mac:~ jianzhang$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.4.0-0.nightly-2020-04-01-213929   True        False         63m     Cluster version is 4.4.0-0.nightly-2020-04-01-213929

1, Create a CatalogSource that reference index image: quay.io/olmqe/app-operator-index:0.0.4
mac:~ jianzhang$ oc create -f cs-index.yaml 
catalogsource.operators.coreos.com/index-test created
mac:~ jianzhang$ cat cs-index.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: index-test
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/olmqe/app-operator-index:0.0.4
  displayName: Bug Operators
  publisher: jian

mac:~ jianzhang$ oc get catalogsource -A
NAMESPACE               NAME                  DISPLAY               TYPE   PUBLISHER   AGE
openshift-marketplace   certified-operators   Certified Operators   grpc   Red Hat     79m
openshift-marketplace   community-operators   Community Operators   grpc   Red Hat     79m
openshift-marketplace   index-test            Bug Operators         grpc   jian        61s
openshift-marketplace   redhat-marketplace    Red Hat Marketplace   grpc   Red Hat     79m
openshift-marketplace   redhat-operators      Red Hat Operators     grpc   Red Hat     79m
mac:~ jianzhang$ oc get pods -n openshift-marketplace
NAME                                    READY   STATUS    RESTARTS   AGE
certified-operators-549565d9d4-gtptb    1/1     Running   0          79m
community-operators-75f67fbdf9-vwjg7    1/1     Running   0          79m
index-test-jz78s                        1/1     Running   0          85s
marketplace-operator-56fb579c67-qqwn6   1/1     Running   0          80m
redhat-marketplace-ff975c7f6-6zwd9      1/1     Running   0          79m
redhat-operators-5d4fbd797c-xllpv       1/1     Running   0          79m
mac:~ jianzhang$ 
mac:~ jianzhang$ oc get packagemanifest |grep -i bug
app-operator                                 Bug Operators         119s

2, Subscribe this operator, it works well.
mac:~ jianzhang$ oc get sub -A
NAMESPACE             NAME           PACKAGE        SOURCE       CHANNEL
openshift-operators   app-operator   app-operator   index-test   alpha
mac:~ jianzhang$ oc get csv -n openshift-operators 
NAME                  DISPLAY        VERSION   REPLACES   PHASE
app-operator.v0.0.4   App Operator   0.0.4                Succeeded
mac:~ jianzhang$ oc get pods -n openshift-operators 
NAME                            READY   STATUS    RESTARTS   AGE
app-operator-7c6556f844-zlvg9   1/1     Running   0          32s

3, Update this index image to quay.io/olmqe/app-operator-index:0.0.5

mac:~ jianzhang$ oc edit catalogsource index-test -n openshift-marketplace
catalogsource.operators.coreos.com/index-test edited
mac:~ jianzhang$  oc get pods -n openshift-marketplace
NAME                                                              READY   STATUS      RESTARTS   AGE
518d01601d3759fb57704daa271263bf5f136a471ed53edb75519eb4a24hlnj   0/1     Completed   0          27s
certified-operators-549565d9d4-gtptb                              1/1     Running     0          85m
community-operators-75f67fbdf9-vwjg7                              1/1     Running     0          85m
daf4cac1a217f4c3ed36204a7cfec3cbdd4f7a259a048cf45a4e372a42tcl5k   0/1     Completed   0          2m51s
index-test-xblcw                                                  1/1     Running     0          50s
marketplace-operator-56fb579c67-qqwn6                             1/1     Running     0          85m
redhat-marketplace-ff975c7f6-6zwd9                                1/1     Running     0          85m
redhat-operators-5d4fbd797c-xllpv                                 1/1     Running     0          85m
mac:~ jianzhang$ oc get sub -n openshift-operators
NAME           PACKAGE        SOURCE       CHANNEL
app-operator   app-operator   index-test   alpha
mac:~ jianzhang$ oc get csv -n openshift-operators
NAME                  DISPLAY        VERSION   REPLACES              PHASE
app-operator.v0.0.5   App Operator   0.0.5     app-operator.v0.0.4   Succeeded
mac:~ jianzhang$ oc get pods -n openshift-operators
NAME                            READY   STATUS    RESTARTS   AGE
app-operator-7c6556f844-zlvg9   1/1     Running   0          3m19s

The installed operator can be upgraded successfully. LGTM, verify it.

Comment 5 errata-xmlrpc 2020-05-13 22:01:14 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, 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/RHBA-2020:0581