Bug 1978310

Summary: OLM dependencies not fixing version
Product: OpenShift Container Platform Reporter: apahim
Component: OLMAssignee: Ben Luddy <bluddy>
OLM sub component: OLM QA Contact: kuiwang
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: amoran, bluddy, davegord, dmesser, omitrani, pbergene, sblaisdo
Version: 4.7Keywords: Triaged
Target Milestone: ---Flags: sblaisdo: needinfo+
Target Release: 4.9.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Operator dependencies were not always persisted after installation time. Consequence: After installing an operator that declares dependencies, later updates and installations within the same namespace could fail to honor the already-installed operator's dependencies. Fix: Dependencies are persisted, along with all declared properties for the operator, in an annotation on the operator's ClusterServiceVersion. Result: The declared dependencies of installed operators continue to be respected for future installations.
Story Points: ---
Clone Of:
: 1986023 (view as bug list) Environment:
Last Closed: 2021-10-18 17:37:30 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:
Bug Depends On:    
Bug Blocks: 1986023    

Description apahim 2021-07-01 13:57:51 UTC
Description of problem:

OLM upgrades the dependencies, ignoring the version specified in the dependencies.yaml


How reproducible:

100%


Steps to Reproduce:
1. add a dependencies.yaml file to the Operator bundle, containing:

dependencies:
- type: olm.package
  value:
    packageName: prometheus
    version: "0.37.0"

2. install the operator using OLM

Actual results:

1. prometheus is installed on version 0.37.0.
2. because there's a version 0.47.0 in the catalog prometheus is coming from, OLM upgrades prometheus to version 0.47.0.
3. cluster is now in an unexpected state.

Expected results:

1. prometheus is installed on version 0.37.0.
2. No upgrades to prometheus happens until the dependencies.yaml changes the version to the new one.


Additional info:


I tested some scenarios:

Main operator called "reference-addon"
Dependency operator called "prometheus"

----------------------------------------

Scenario 1:
- catalog created containing only reference-addon v0.1.0
- dependencies.yaml specifying prometheus v0.37.0
- subscription for reference-addon with installPlanApproval as "Automatic"

Results:
- OLM installs reference-addon 0.1.0
- OLM installs prometheus 0.37.0
- OLM upgrades prometheus to 0.47.0, as it's available in the community catalog

Expected state:
- reference-addon 0.1.0
- prometheus 0.37.0
- no pending upgrades

Current state:
- reference-addon 0.1.0
- prometheus 0.47.0
- no pending upgrades

----------------------------------------

Scenario 2 (Manual approval):
- catalog created containing only reference-addon v0.1.0
- dependencies.yaml specifying prometheus v0.37.0
- subscription for reference-addon with installPlanApproval as "Manual".

Results:
- pending installation for reference-addon 0.1.0
- pending installation for prometheus 0.37.0
- when approved, OLM instals reference-addon 0.1.0 and prometheus 0.37.0
- there's a pending upgrade to prometheus 0.47.0

Expected state:
- reference-addon 0.1.0
- prometheus 0.37.0
- no pending upgrades

Current state:
- reference-addon 0.1.0
- prometheus 0.37.0
- pending prometheus upgrade

Then, a new version of the reference-addon is included in the catalog:
- catalog now contains reference-addon v0.1.0 and reference-addon v0.2.0
- pending upgrade for reference-addon 0.2.0 and prometheus 0.47.0 *in the same installPlan*
- approving that installPlan upgrades reference-addon to 0.2.0 and prometheus to 0.47.0

Expected state:
- reference-addon 0.2.0
- prometheus 0.37.0
- no pending upgrades

Current state:
- reference-addon 0.2.0
- prometheus 0.47.0
- no pending upgrades

----------------------------------------

Scenario 3 (no OLM dependencies.yaml):
- catalog created containing only reference-addon v0.1.0
- no dependencies.yaml file
- subscription for reference-addon with installPlanApproval as "Automatic"
- subscription for prometheus with installPlanApproval as Manual and startingCSV as "prometheusoperator.0.37.0"

Results:
- OLM installs reference-addon 0.1.0
- pending installation for prometheus 0.37.0
- when approved, OLM instals prometheus 0.37.0
- there's a pending upgrade to prometheus 0.47.0

Expected state:
- reference-addon 0.1.0
- prometheus 0.37.0
- no pending upgrades

Current state:
- reference-addon 0.1.0
- prometheus 0.37.0
- pending prometheus upgrade

Then, a new version of the reference-addon is included in the catalog:
- catalog now contains reference-addon v0.1.0 and reference-addon v0.2.0
- pending upgrade for reference-addon 0.2.0 and prometheus 0.47.0 *in the same installPlan*
- approving that installPlan upgrades reference-addon to 0.2.0 and prometheus to 0.47.0

Expected state:
- reference-addon 0.2.0
- prometheus 0.37.0
- no pending upgrades

Current state:
- reference-addon 0.2.0
- prometheus 0.47.0
- no pending upgrades

----------------------------------------

Those tests are telling us that:

- We have to control the catalog of the dependencies.
- We have to control the Subscription of the dependencies, making explicit which catalog it will use (we can't use the OLM dependencies feature).
- Each dependency has to be installed on a separate namespace, so the installPlan created for upgrading one operator doesn't upgrade the others.

Bear in mind, if this is not considered a bug, we will have to implement our own dependencies management, either from Hive or from the main operator. And if it turns out to be the main operator, it means that all the main operators will be cluster-scoped operators.

Comment 1 Ben Luddy 2021-07-01 14:37:55 UTC
This looks like a bug. The package dependency should be projected as a property onto the reference-addon ClusterServiceVersion, but that doesn't happen and effectively loses track of that dependency for the already-installed version.

Comment 2 Ohad 2021-07-01 15:44:31 UTC
As discussed outside of this BZ:
The expected and desired behaviour can be summarized by the following two statements:

1. Dependencies should be locked to the exact versions defined in the dependencies.yaml, even if the target channels have new versions available
2. A new bundle with updated dependencies.yaml should trigger an update

Comment 3 Samuel Blais-Dowdy 2021-07-02 19:40:21 UTC
I have found that using a custom catalog can be a potential workaround. I tested scenario 1 and scenario 3 and my expected results were the actual results. I still believe OLM is behaving unexpectedly as reported above. View the steps and documentation here: https://gitlab.cee.redhat.com/sblaisdo/devtools/-/tree/master/tickets/mtsre_103#bugzilla-potential-workarounds.

Comment 4 Ohad 2021-07-02 19:49:55 UTC
@sblaisdo 
Thank you for the suggestion but the workaround will not work for us as we cannot prevent the cluster from being exposed to the original catalog source, and depenendcies.yaml have no way to specify a specific catalog source so it looks at all of them

Comment 9 kuiwang 2021-07-27 07:55:44 UTC
verify it on 4.9. Fails at Scenario 2 and 3.

---- make bundle and index image ----
[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm alpha bundle build -d mta-operator/0.0.4/manifests -t quay.io/olmqe/mta-operator:v0.0.4-1978310 -p mta-operator -c alpha -e alpha
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/mta-operator/0.0.4/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=mta-operator
--> Using cache ee133dc338547e23aed59e6f9cdee9a83b75668b276ac3f5796238cc56e4092e
--> ee133dc3385
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=alpha
--> Using cache a249c67bc7a1b32f36a2946b986e6aac86a96c281f64e69a2c22ecb26472264d
--> a249c67bc7a
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
--> Using cache 6c96f100ff64df79eed5355bea338f3e307ce1a93f893fa554e74b1b6f8c5af0
--> 6c96f100ff6
STEP 8: COPY mta-operator/0.0.4/manifests /manifests/
--> d1ca17a4ebc
STEP 9: COPY mta-operator/0.0.4/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/mta-operator:v0.0.4-1978310
--> 7d231e9f65b
7d231e9f65b54ed530a284515da7aaddd2d30026545760359e7f27872791a57a
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/mta-operator:v0.0.4-1978310
Getting image source signatures
Copying blob 494fdb3754ec done  
Copying blob 6145de31e036 done  
Copying config 7d231e9f65 done  
Writing manifest to image destination
Copying config 7d231e9f65 [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile mta-operator/0.0.4/metadata
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm alpha bundle build -d mta-operator/0.0.5/manifests -t quay.io/olmqe/mta-operator:v0.0.5-1978310 -p mta-operator -c alpha -e alpha
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/mta-operator/0.0.5/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=mta-operator
--> Using cache ee133dc338547e23aed59e6f9cdee9a83b75668b276ac3f5796238cc56e4092e
--> ee133dc3385
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=alpha
--> Using cache a249c67bc7a1b32f36a2946b986e6aac86a96c281f64e69a2c22ecb26472264d
--> a249c67bc7a
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
--> Using cache 6c96f100ff64df79eed5355bea338f3e307ce1a93f893fa554e74b1b6f8c5af0
--> 6c96f100ff6
STEP 8: COPY mta-operator/0.0.5/manifests /manifests/
--> 67d536bd009
STEP 9: COPY mta-operator/0.0.5/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/mta-operator:v0.0.5-1978310
--> e7294b04ad3
e7294b04ad3da8ff96de41a9204a95e8e7da2734281039127a79a74c10c2c13b
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/mta-operator:v0.0.5-1978310
Getting image source signatures
Copying blob 803f9e8da104 done  
Copying blob 329ccbc7b70f done  
Copying config e7294b04ad done  
Writing manifest to image destination
Copying config e7294b04ad [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile mta-operator/0.0.5/metadata/
[root@preserve-olm-env 1978310]# 



[root@preserve-olm-env 1978310]# rm -fr cockroachdb/5.0.3/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]# touch cockroachdb/5.0.3/metadata/dependencies.yaml
[root@preserve-olm-env 1978310]# vi cockroachdb/5.0.3/metadata/dependencies.yaml
[root@preserve-olm-env 1978310]# cat cockroachdb/5.0.3/metadata/dependencies.yaml
dependencies:
- type: olm.package
  value:
    packageName: mta-operator
    version: "0.0.4"
[root@preserve-olm-env 1978310]# 


[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm alpha bundle build -d cockroachdb/5.0.3/manifests -t quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 -p cockroachdb -c stable -e stable
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/cockroachdb/5.0.3/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=cockroachdb
--> 148bad8a91a
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=stable
--> 13381a1dc0b
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
--> a33a67dc4ac
STEP 8: COPY cockroachdb/5.0.3/manifests /manifests/
--> e1e2bc9cd21
STEP 9: COPY cockroachdb/5.0.3/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/cockroachdb-operator:5.0.3-1978310
--> fa24156cd94
fa24156cd94e416e2c93825021946330baee3cd386564720597837b1e161044a
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/cockroachdb-operator:5.0.3-1978310
Getting image source signatures
Copying blob 2d855034f0b6 done  
Copying blob 72dc9860800f done  
Copying config fa24156cd9 done  
Writing manifest to image destination
Copying config fa24156cd9 [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile cockroachdb/5.0.3/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1978310,quay.io/olmqe/mta-operator:v0.0.5-1978310,quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 -t quay.io/kuiwang/olm-index:1978310-onecatlog -c podman --mode semver
INFO[0000] building the index                            bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0000] running /usr/bin/podman pull quay.io/olmqe/mta-operator:v0.0.4-1978310  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0000] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0001] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0001] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0001] running /usr/bin/podman pull quay.io/olmqe/mta-operator:v0.0.5-1978310  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0002] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0002] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0003] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0003] running /usr/bin/podman pull quay.io/olmqe/cockroachdb-operator:5.0.3-1978310  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] Could not find optional dependencies file     file=bundle_tmp996083599/metadata load=annotations with=bundle_tmp996083599
INFO[0004] Could not find optional properties file       file=bundle_tmp996083599/metadata load=annotations with=bundle_tmp996083599
INFO[0004] Could not find optional dependencies file     file=bundle_tmp661385634/metadata load=annotations with=bundle_tmp661385634
INFO[0004] Could not find optional properties file       file=bundle_tmp661385634/metadata load=annotations with=bundle_tmp661385634
INFO[0004] Could not find optional properties file       file=bundle_tmp537627289/metadata load=annotations with=bundle_tmp537627289
INFO[0004] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] writing dockerfile: index.Dockerfile566535829  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] [podman build --format docker -f index.Dockerfile566535829 -t quay.io/kuiwang/olm-index:1978310-onecatlog .]  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
[root@preserve-olm-env 1978310]# podman push quay.io/kuiwang/olm-index:1978310-onecatlog 
Getting image source signatures
Copying blob 659bc3be3b52 done  
Copying blob 55dfd992c4eb skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying blob 094d78802b07 skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying blob 88d2b1b8a4ca [--------------------------------------] 0.0b / 0.0b
Copying config b9acc5fb98 done  
Writing manifest to image destination
Writing manifest to image destination
Storing signatures

[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile cockroachdb/5.0.4/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm alpha bundle build -d cockroachdb/5.0.4/manifests -t quay.io/olmqe/cockroachdb-operator:5.0.4-1978310 -p cockroachdb -c stable -e stable
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/cockroachdb/5.0.4/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=cockroachdb
--> Using cache 148bad8a91a0beb8625586963e4434807168790368841ec826d41641267e586d
--> 148bad8a91a
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=stable
--> Using cache 13381a1dc0b99d2a4d51c39855e82ecef63a8ee1e3590e68ce2d158d34e15c45
--> 13381a1dc0b
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
--> Using cache a33a67dc4ac39b68012f1013fd4f908d40ed95d6fef24ad586f35540d18de01e
--> a33a67dc4ac
STEP 8: COPY cockroachdb/5.0.4/manifests /manifests/
--> 883ab4d0255
STEP 9: COPY cockroachdb/5.0.4/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/cockroachdb-operator:5.0.4-1978310
--> 0df0c9e8ad8
0df0c9e8ad8783004f4da39c0695c06a8f438295427b8ee0f9aeeb870ece3e6a
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/cockroachdb-operator:5.0.4-1978310
Getting image source signatures
Copying blob 7a854bee6571 done  
Copying blob bd389be569b1 done  
Copying config 0df0c9e8ad done  
Writing manifest to image destination
Copying config 0df0c9e8ad [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile cockroachdb/5.0.4/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1978310,quay.io/olmqe/mta-operator:v0.0.5-1978310,quay.io/olmqe/cockroachdb-operator:5.0.3-1978310,quay.io/olmqe/cockroachdb-operator:5.0.4-1978310  -t quay.io/kuiwang/olm-index:1978310-twocatlog -c podman --mode semver
...
INFO[0006] Could not find optional dependencies file     file=bundle_tmp155181820/metadata load=annotations with=bundle_tmp155181820
INFO[0006] Could not find optional properties file       file=bundle_tmp155181820/metadata load=annotations with=bundle_tmp155181820
INFO[0006] Could not find optional dependencies file     file=bundle_tmp239191595/metadata load=annotations with=bundle_tmp239191595
INFO[0006] Could not find optional properties file       file=bundle_tmp239191595/metadata load=annotations with=bundle_tmp239191595
INFO[0006] Could not find optional properties file       file=bundle_tmp438734222/metadata load=annotations with=bundle_tmp438734222
INFO[0006] Could not find optional dependencies file     file=bundle_tmp129072533/metadata load=annotations with=bundle_tmp129072533
INFO[0006] Could not find optional properties file       file=bundle_tmp129072533/metadata load=annotations with=bundle_tmp129072533
INFO[0006] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
INFO[0006] writing dockerfile: index.Dockerfile924352442  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
INFO[0006] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
INFO[0006] [podman build --format docker -f index.Dockerfile924352442 -t quay.io/kuiwang/olm-index:1978310-twocatlog .]  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
[root@preserve-olm-env 1978310]# podman push quay.io/kuiwang/olm-index:1978310-twocatlog
Getting image source signatures
Copying blob 10db8d573722 done  
Copying blob 094d78802b07 skipped: already exists  
Copying blob 55dfd992c4eb skipped: already exists  
Copying blob 88d2b1b8a4ca skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying config 0364fb5633 done  
Writing manifest to image destination
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# rm -fr cockroachdb/5.0.3/metadata/
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# ../../operator-framework-olm/bin/opm alpha bundle build -d cockroachdb/5.0.3/manifests -t quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep -p cockroachdb -c stable -e stable
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/cockroachdb/5.0.3/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=cockroachdb
--> Using cache 148bad8a91a0beb8625586963e4434807168790368841ec826d41641267e586d
--> 148bad8a91a
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=stable
--> Using cache 13381a1dc0b99d2a4d51c39855e82ecef63a8ee1e3590e68ce2d158d34e15c45
--> 13381a1dc0b
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
--> Using cache a33a67dc4ac39b68012f1013fd4f908d40ed95d6fef24ad586f35540d18de01e
--> a33a67dc4ac
STEP 8: COPY cockroachdb/5.0.3/manifests /manifests/
--> Using cache e1e2bc9cd21df76e0dea7e7095eefad7610fecb537b2e0bc540b09b50c6b03ea
--> e1e2bc9cd21
STEP 9: COPY cockroachdb/5.0.3/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep
--> b1d8305d649
b1d8305d64965cd0e41f6de98155bedba0d66f36513d5dd44f942182b0a5f05b
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep
Getting image source signatures
Copying blob 5bc2a9b26d9f done  
Copying blob 2d855034f0b6 skipped: already exists  
Copying config b1d8305d64 done  
Writing manifest to image destination
Copying config b1d8305d64 [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# ../../operator-framework-olm/bin/opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1978310,quay.io/olmqe/mta-operator:v0.0.5-1978310,quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep  -t quay.io/kuiwang/olm-index:1978310-onecatlog-nodep -c podman --mode semver
INFO[0000] building the index                            bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
...
INFO[0005] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
INFO[0005] writing dockerfile: index.Dockerfile093567112  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
INFO[0005] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
INFO[0005] [podman build --format docker -f index.Dockerfile093567112 -t quay.io/kuiwang/olm-index:1978310-onecatlog-nodep .]  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
[root@preserve-olm-env 1978310]# podman push quay.io/kuiwang/olm-index:1978310-onecatlog-nodep
Getting image source signatures
Copying blob 2963a3fee415 done  
Copying blob 55dfd992c4eb skipped: already exists  
Copying blob 094d78802b07 skipped: already exists  
Copying blob 88d2b1b8a4ca skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying config 7e3d3014eb done  
Writing manifest to image destination
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# ../../operator-framework-olm/bin/opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1978310,quay.io/olmqe/mta-operator:v0.0.5-1978310,quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep,quay.io/olmqe/cockroachdb-operator:5.0.4-1978310  -t quay.io/kuiwang/olm-index:1978310-twocatlog-nodep -c podman --mode semver
...
INFO[0006] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
INFO[0006] writing dockerfile: index.Dockerfile782776307  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
INFO[0006] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
INFO[0006] [podman build --format docker -f index.Dockerfile782776307 -t quay.io/kuiwang/olm-index:1978310-twocatlog-nodep .]  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
[root@preserve-olm-env 1978310]# podman push quay.io/kuiwang/olm-index:1978310-twocatlog-nodep
Getting image source signatures
Copying blob aca76cfc3aca done  
Copying blob 55dfd992c4eb skipped: already exists  
Copying blob 094d78802b07 skipped: already exists  
Copying blob 88d2b1b8a4ca skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying config a0cdbe2bec done  
Writing manifest to image destination
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# 


----


---- start to test scenario 1 which is OK----
[root@preserve-olm-env 1978310]# oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.9.0-0.nightly-2021-07-26-220837   True        False         7m8s    Cluster version is 4.9.0-0.nightly-2021-07-26-220837
[root@preserve-olm-env 1978310]#
[root@preserve-olm-env 1978310]# oc get pod -n openshift-operator-lifecycle-manager
NAME                                      READY   STATUS      RESTARTS   AGE
catalog-operator-5f49fb5c8d-wqbsj         1/1     Running     0          36m
collect-profiles-27122775-6rwrq           0/1     Completed   0          32m
collect-profiles-27122790-8xfqr           0/1     Completed   0          17m
collect-profiles-27122805-gdq5x           0/1     Completed   0          2m36s
olm-operator-5bfc4cfc4b-djbx7             1/1     Running     0          36m
package-server-manager-686844cb9b-gq9wq   1/1     Running     2          36m
packageserver-7cb76bc777-jv77b            1/1     Running     0          33m
packageserver-7cb76bc777-p99b9            1/1     Running     0          33m
[root@preserve-olm-env 1978310]# oc exec catalog-operator-5f49fb5c8d-wqbsj -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.18.3
git commit: 4a5ad031bf1e4888b01792f70a8c1a159719626b
[root@preserve-olm-env 1978310]# 


[root@preserve-olm-env 1978310]# cat og-single.yaml 
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single1
  namespace: default
spec:
  targetNamespaces:
  - default
[root@preserve-olm-env 1978310]# cat catsrc.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: cockroachdb-catalog
  namespace: default
spec:
  displayName: cockroachdb Operator Catalog
  image: quay.io/kuiwang/olm-index:1978310-onecatlog
  publisher: QE
  sourceType: grpc
  updateStrategy:
      registryPoll:
        interval: "2m0s"
[root@preserve-olm-env 1978310]# cat sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: cockroachdb
  namespace: default
spec:
  channel: stable
  installPlanApproval: Automatic
  name: cockroachdb
  source: cockroachdb-catalog
  sourceNamespace: default
[root@preserve-olm-env 1978310]# oc apply -f og-single.yaml
operatorgroup.operators.coreos.com/og-single1 created
[root@preserve-olm-env 1978310]# oc apply -f catsrc.yaml
catalogsource.operators.coreos.com/cockroachdb-catalog created
[root@preserve-olm-env 1978310]# oc apply -f sub.yaml 
subscription.operators.coreos.com/cockroachdb created
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# oc get sub
NAME                                             PACKAGE        SOURCE                CHANNEL
cockroachdb                                      cockroachdb    cockroachdb-catalog   stable
mta-operator-alpha-cockroachdb-catalog-default   mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                  APPROVAL    APPROVED
install-8lnfw   cockroachdb.v5.0.3   Automatic   true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Installing
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Installing
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# oc delete sub mta-operator-alpha-cockroachdb-catalog-default 
subscription.operators.coreos.com "mta-operator-alpha-cockroachdb-catalog-default" deleted
[root@preserve-olm-env 1978310]# oc delete sub cockroachdb
subscription.operators.coreos.com "cockroachdb" deleted
[root@preserve-olm-env 1978310]# oc delete csv windup-operator.0.0.4
clusterserviceversion.operators.coreos.com "windup-operator.0.0.4" deleted
[root@preserve-olm-env 1978310]# oc delete csv cockroachdb.v5.0.3
clusterserviceversion.operators.coreos.com "cockroachdb.v5.0.3" deleted
[root@preserve-olm-env 1978310]# 
----

---- continue to test scenario 2 which fails---
[root@preserve-olm-env 1978310]# cat sub-manual.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: cockroachdb
  namespace: default
spec:
  channel: stable
  installPlanApproval: Manual
  name: cockroachdb
  source: cockroachdb-catalog
  sourceNamespace: default
[root@preserve-olm-env 1978310]# oc apply -f sub-manual.yaml 
subscription.operators.coreos.com/cockroachdb created
[root@preserve-olm-env 1978310]# oc get sub
NAME          PACKAGE       SOURCE                CHANNEL
cockroachdb   cockroachdb   cockroachdb-catalog   stable
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-7wf8b   windup-operator.0.0.4   Manual     false
[root@preserve-olm-env 1978310]# oc get csv
No resources found in default namespace.
[root@preserve-olm-env 1978310]# oc edit ip install-7wf8b
installplan.operators.coreos.com/install-7wf8b edited
##it is to approve ip
[root@preserve-olm-env 1978310]# 


[root@preserve-olm-env 1978310]# oc get sub
NAME                                             PACKAGE        SOURCE                CHANNEL
cockroachdb                                      cockroachdb    cockroachdb-catalog   stable
mta-operator-alpha-cockroachdb-catalog-default   mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-7wf8b   windup-operator.0.0.4   Manual     true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# 

till now, they are expected.

[root@preserve-olm-env 1978310]# oc get catsrc
NAME                  DISPLAY                        TYPE   PUBLISHER   AGE
cockroachdb-catalog   cockroachdb Operator Catalog   grpc   QE          15m
[root@preserve-olm-env 1978310]# oc edit catsrc cockroachdb-catalog
catalogsource.operators.coreos.com/cockroachdb-catalog edited 
//change index from quay.io/kuiwang/olm-index:1978310-onecatlog to quay.io/kuiwang/olm-index:1978310-twocatlog
//to upgrade cockroachdb to 5.0.4 and still expect to keep windup-operator as 0.0.4
[root@preserve-olm-env 1978310]#

[root@preserve-olm-env 1978310]# oc get sub
NAME                                             PACKAGE        SOURCE                CHANNEL
cockroachdb                                      cockroachdb    cockroachdb-catalog   stable
mta-operator-alpha-cockroachdb-catalog-default   mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-7wf8b   windup-operator.0.0.4   Manual     true
install-vjnpc   windup-operator.0.0.5   Manual     false
// it is stranger to have ip for 0.0.5 
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# oc edit ip install-vjnpc
installplan.operators.coreos.com/install-vjnpc edited
//edit ip to approve it.
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-7wf8b   windup-operator.0.0.4   Manual     true
install-vjnpc   windup-operator.0.0.5   Manual     true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES                PHASE
cockroachdb.v5.0.4      CockroachDB Helm Operator                     5.0.4     cockroachdb.v5.0.3      Succeeded
windup-operator.0.0.5   Migration Toolkit for Applications Operator   0.0.5     windup-operator.0.0.4   Succeeded
//mta upgrade to 0.0.5, but we expect it still kept as 0.0.4. so fails.
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# oc get sub
NAME                                             PACKAGE        SOURCE                CHANNEL
cockroachdb                                      cockroachdb    cockroachdb-catalog   stable
mta-operator-alpha-cockroachdb-catalog-default   mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc delete sub cockroachdb
subscription.operators.coreos.com "cockroachdb" deleted
[root@preserve-olm-env 1978310]# oc delete sub mta-operator-alpha-cockroachdb-catalog-default
subscription.operators.coreos.com "mta-operator-alpha-cockroachdb-catalog-default" deleted
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES                PHASE
cockroachdb.v5.0.4      CockroachDB Helm Operator                     5.0.4     cockroachdb.v5.0.3      Succeeded
windup-operator.0.0.5   Migration Toolkit for Applications Operator   0.0.5     windup-operator.0.0.4   Succeeded
[root@preserve-olm-env 1978310]# oc delete csv cockroachdb.v5.0.4
clusterserviceversion.operators.coreos.com "cockroachdb.v5.0.4" deleted
[root@preserve-olm-env 1978310]# oc delete csv windup-operator.0.0.5
clusterserviceversion.operators.coreos.com "windup-operator.0.0.5" deleted
[root@preserve-olm-env 1978310]# oc get ip
No resources found in default namespace.
[root@preserve-olm-env 1978310]# oc get catsrc
NAME                  DISPLAY                        TYPE   PUBLISHER   AGE
cockroachdb-catalog   cockroachdb Operator Catalog   grpc   QE          35m
[root@preserve-olm-env 1978310]# oc delete catsrdc cockroachdb-catalog
error: the server doesn't have a resource type "catsrdc"
[root@preserve-olm-env 1978310]# oc delete catsrc cockroachdb-catalog
catalogsource.operators.coreos.com "cockroachdb-catalog" deleted
[root@preserve-olm-env 1978310]# 

---

---continue to test scenario 3 which also fails---
[root@preserve-olm-env 1978310]# cat catsrc-nodep.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: cockroachdb-catalog
  namespace: default
spec:
  displayName: cockroachdb Operator Catalog
  image: quay.io/kuiwang/olm-index:1978310-onecatlog-nodep
  publisher: QE
  sourceType: grpc
  updateStrategy:
      registryPoll:
        interval: "2m0s"
[root@preserve-olm-env 1978310]# cat sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: cockroachdb
  namespace: default
spec:
  channel: stable
  installPlanApproval: Automatic
  name: cockroachdb
  source: cockroachdb-catalog
  sourceNamespace: default
[root@preserve-olm-env 1978310]# cat mta-sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: mta
  namespace: default
spec:
  channel: alpha
  installPlanApproval: Manual
  name: mta-operator
  source: cockroachdb-catalog
  sourceNamespace: default
  startingCSV: "windup-operator.0.0.4"
[root@preserve-olm-env 1978310]# oc apply -f catsrc-nodep.yaml 
catalogsource.operators.coreos.com/cockroachdb-catalog created
[root@preserve-olm-env 1978310]# oc apply -f sub.yaml 
subscription.operators.coreos.com/cockroachdb created
[root@preserve-olm-env 1978310]# oc apply -f mta-sub.yaml 
subscription.operators.coreos.com/mta created
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# oc get sub
NAME          PACKAGE        SOURCE                CHANNEL
cockroachdb   cockroachdb    cockroachdb-catalog   stable
mta           mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      false
[root@preserve-olm-env 1978310]# oc edit ip install-wzgzn
installplan.operators.coreos.com/install-wzgzn edited
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      false
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# oc get catsrc
NAME                  DISPLAY                        TYPE   PUBLISHER   AGE
cockroachdb-catalog   cockroachdb Operator Catalog   grpc   QE          2m20s
[root@preserve-olm-env 1978310]# oc edit catsrc cockroachdb-catalog
catalogsource.operators.coreos.com/cockroachdb-catalog edited
// change quay.io/kuiwang/olm-index:1978310-onecatlog-nodep to quay.io/kuiwang/olm-index:1978310-twocatlog-nodep
[root@preserve-olm-env 1978310]# oc get sub
NAME          PACKAGE        SOURCE                CHANNEL
cockroachdb   cockroachdb    cockroachdb-catalog   stable
mta           mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      false
// cockroachdb reuse mta's ip, so we have to approve mta's ip although sub cockroachdb is automatic approval.
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# oc edit ip install-xg7m7
installplan.operators.coreos.com/install-xg7m7 edited
// approve ip
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      true
install-xq5wz   cockroachdb.v5.0.4      Manual      false
// cockroachdb should be automatic, but here it become manual
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      true
install-xq5wz   cockroachdb.v5.0.4      Manual      false
[root@preserve-olm-env 1978310]# oc get ip install-xq5wz 
NAME            CSV                  APPROVAL   APPROVED
install-xq5wz   cockroachdb.v5.0.4   Manual     false
[root@preserve-olm-env 1978310]# oc edit ip install-xq5wz
installplan.operators.coreos.com/install-xq5wz edited
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      true
install-xq5wz   cockroachdb.v5.0.4      Manual      true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES                PHASE
cockroachdb.v5.0.4      CockroachDB Helm Operator                     5.0.4     cockroachdb.v5.0.3      Succeeded
windup-operator.0.0.5   Migration Toolkit for Applications Operator   0.0.5     windup-operator.0.0.4   Succeeded
//we expect 5.0.4 automatic upgrade, no manual approve. and mta keep 0.0.4 (not reuse its ip, and then we do not approve mta's ip to keep it as 0.0.4).
//now in order to upgrade cockroachdb to 5.0.4, we have to approve mta's ip because it resuse mta's ip.
[root@preserve-olm-env 1978310]# 

---

Comment 10 Ben Luddy 2021-07-27 15:51:36 UTC
> //change index from quay.io/kuiwang/olm-index:1978310-onecatlog to quay.io/kuiwang/olm-index:1978310-twocatlog
> //to upgrade cockroachdb to 5.0.4 and still expect to keep windup-operator as 0.0.4

The content of "quay.io/kuiwang/olm-index:1978310-twocatlog" is:

{
  "packageName": "cockroachdb",
  "channelName": "stable",
  "csvName": "cockroachdb.v5.0.3",
  "replaces": null,
  "properties": [
    {
      "type": "olm.gvk",
      "value": {
        "group": "charts.operatorhub.io",
        "kind": "Cockroachdb",
        "version": "v1alpha1"
      }
    },
    {
      "type": "olm.package",
      "value": {
        "packageName": "cockroachdb",
        "version": "5.0.3"
      }
    }
  ],
  "dependencies": [
    {
      "type": "olm.package",
      "value": {
        "packageName": "mta-operator",
        "version": "0.0.4"
      }
    }
  ]
}
{
  "packageName": "cockroachdb",
  "channelName": "stable",
  "csvName": "cockroachdb.v5.0.4",
  "replaces": "cockroachdb.v5.0.3",
  "properties": [
    {
      "type": "olm.gvk",
      "value": {
        "group": "charts.operatorhub.io",
        "kind": "Cockroachdb",
        "version": "v1alpha1"
      }
    },
    {
      "type": "olm.package",
      "value": {
        "packageName": "cockroachdb",
        "version": "5.0.4"
      }
    }
  ],
  "dependencies": []
}
{
  "packageName": "mta-operator",
  "channelName": "alpha",
  "csvName": "windup-operator.0.0.4",
  "replaces": null,
  "properties": [
    {
      "type": "olm.gvk",
      "value": {
        "group": "windup.jboss.org",
        "kind": "Windup",
        "version": "v1"
      }
    },
    {
      "type": "olm.package",
      "value": {
        "packageName": "mta-operator",
        "version": "0.0.4"
      }
    }
  ],
  "dependencies": []
}
{
  "packageName": "mta-operator",
  "channelName": "alpha",
  "csvName": "windup-operator.0.0.5",
  "replaces": "windup-operator.0.0.4",
  "properties": [
    {
      "type": "olm.gvk",
      "value": {
        "group": "windup.jboss.org",
        "kind": "Windup",
        "version": "v1"
      }
    },
    {
      "type": "olm.package",
      "value": {
        "packageName": "mta-operator",
        "version": "0.0.5"
      }
    }
  ],
  "dependencies": []
}

Note that "cockroachdb.v5.0.4" does not have a dependency on windup-operator, so {cockroachdb.v5.0.4 windup-operator.0.0.5} is the expected decision.

Similarly for scenario 3, what happened is the expected behavior. One InstallPlan is generated that reflects changes for all Subscriptions in a namespace -- the "CSV" column you see in the "oc" output is only the first in a list of one or more CSVs (https://github.com/operator-framework/api/blob/01e8bf8bd934a18aef1d22e9e4c523f293b2a633/pkg/operators/v1alpha1/installplan_types.go#L350). If any one Subscription is configured for Manual approval, the InstallPlan will require manual approval.

Comment 12 kuiwang 2021-07-28 03:09:06 UTC
verify it on 4.9. LGTM

---- make bundle and index image ----
[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm alpha bundle build -d mta-operator/0.0.4/manifests -t quay.io/olmqe/mta-operator:v0.0.4-1978310 -p mta-operator -c alpha -e alpha
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/mta-operator/0.0.4/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=mta-operator
--> Using cache ee133dc338547e23aed59e6f9cdee9a83b75668b276ac3f5796238cc56e4092e
--> ee133dc3385
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=alpha
--> Using cache a249c67bc7a1b32f36a2946b986e6aac86a96c281f64e69a2c22ecb26472264d
--> a249c67bc7a
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
--> Using cache 6c96f100ff64df79eed5355bea338f3e307ce1a93f893fa554e74b1b6f8c5af0
--> 6c96f100ff6
STEP 8: COPY mta-operator/0.0.4/manifests /manifests/
--> d1ca17a4ebc
STEP 9: COPY mta-operator/0.0.4/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/mta-operator:v0.0.4-1978310
--> 7d231e9f65b
7d231e9f65b54ed530a284515da7aaddd2d30026545760359e7f27872791a57a
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/mta-operator:v0.0.4-1978310
Getting image source signatures
Copying blob 494fdb3754ec done  
Copying blob 6145de31e036 done  
Copying config 7d231e9f65 done  
Writing manifest to image destination
Copying config 7d231e9f65 [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile mta-operator/0.0.4/metadata
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm alpha bundle build -d mta-operator/0.0.5/manifests -t quay.io/olmqe/mta-operator:v0.0.5-1978310 -p mta-operator -c alpha -e alpha
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/mta-operator/0.0.5/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=mta-operator
--> Using cache ee133dc338547e23aed59e6f9cdee9a83b75668b276ac3f5796238cc56e4092e
--> ee133dc3385
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=alpha
--> Using cache a249c67bc7a1b32f36a2946b986e6aac86a96c281f64e69a2c22ecb26472264d
--> a249c67bc7a
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
--> Using cache 6c96f100ff64df79eed5355bea338f3e307ce1a93f893fa554e74b1b6f8c5af0
--> 6c96f100ff6
STEP 8: COPY mta-operator/0.0.5/manifests /manifests/
--> 67d536bd009
STEP 9: COPY mta-operator/0.0.5/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/mta-operator:v0.0.5-1978310
--> e7294b04ad3
e7294b04ad3da8ff96de41a9204a95e8e7da2734281039127a79a74c10c2c13b
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/mta-operator:v0.0.5-1978310
Getting image source signatures
Copying blob 803f9e8da104 done  
Copying blob 329ccbc7b70f done  
Copying config e7294b04ad done  
Writing manifest to image destination
Copying config e7294b04ad [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile mta-operator/0.0.5/metadata/
[root@preserve-olm-env 1978310]# 



[root@preserve-olm-env 1978310]# rm -fr cockroachdb/5.0.3/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]# touch cockroachdb/5.0.3/metadata/dependencies.yaml
[root@preserve-olm-env 1978310]# vi cockroachdb/5.0.3/metadata/dependencies.yaml
[root@preserve-olm-env 1978310]# cat cockroachdb/5.0.3/metadata/dependencies.yaml
dependencies:
- type: olm.package
  value:
    packageName: mta-operator
    version: "0.0.4"
[root@preserve-olm-env 1978310]# 


[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm alpha bundle build -d cockroachdb/5.0.3/manifests -t quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 -p cockroachdb -c stable -e stable
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/cockroachdb/5.0.3/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=cockroachdb
--> 148bad8a91a
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=stable
--> 13381a1dc0b
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
--> a33a67dc4ac
STEP 8: COPY cockroachdb/5.0.3/manifests /manifests/
--> e1e2bc9cd21
STEP 9: COPY cockroachdb/5.0.3/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/cockroachdb-operator:5.0.3-1978310
--> fa24156cd94
fa24156cd94e416e2c93825021946330baee3cd386564720597837b1e161044a
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/cockroachdb-operator:5.0.3-1978310
Getting image source signatures
Copying blob 2d855034f0b6 done  
Copying blob 72dc9860800f done  
Copying config fa24156cd9 done  
Writing manifest to image destination
Copying config fa24156cd9 [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile cockroachdb/5.0.3/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1978310,quay.io/olmqe/mta-operator:v0.0.5-1978310,quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 -t quay.io/kuiwang/olm-index:1978310-onecatlog -c podman --mode semver
INFO[0000] building the index                            bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0000] running /usr/bin/podman pull quay.io/olmqe/mta-operator:v0.0.4-1978310  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0000] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0001] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0001] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0001] running /usr/bin/podman pull quay.io/olmqe/mta-operator:v0.0.5-1978310  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0002] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0002] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0003] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0003] running /usr/bin/podman pull quay.io/olmqe/cockroachdb-operator:5.0.3-1978310  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] Could not find optional dependencies file     file=bundle_tmp996083599/metadata load=annotations with=bundle_tmp996083599
INFO[0004] Could not find optional properties file       file=bundle_tmp996083599/metadata load=annotations with=bundle_tmp996083599
INFO[0004] Could not find optional dependencies file     file=bundle_tmp661385634/metadata load=annotations with=bundle_tmp661385634
INFO[0004] Could not find optional properties file       file=bundle_tmp661385634/metadata load=annotations with=bundle_tmp661385634
INFO[0004] Could not find optional properties file       file=bundle_tmp537627289/metadata load=annotations with=bundle_tmp537627289
INFO[0004] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] writing dockerfile: index.Dockerfile566535829  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
INFO[0004] [podman build --format docker -f index.Dockerfile566535829 -t quay.io/kuiwang/olm-index:1978310-onecatlog .]  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310]"
[root@preserve-olm-env 1978310]# podman push quay.io/kuiwang/olm-index:1978310-onecatlog 
Getting image source signatures
Copying blob 659bc3be3b52 done  
Copying blob 55dfd992c4eb skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying blob 094d78802b07 skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying blob 88d2b1b8a4ca [--------------------------------------] 0.0b / 0.0b
Copying config b9acc5fb98 done  
Writing manifest to image destination
Writing manifest to image destination
Storing signatures

[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile cockroachdb/5.0.4/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]#  ../../operator-framework-olm/bin/opm alpha bundle build -d cockroachdb/5.0.4/manifests -t quay.io/olmqe/cockroachdb-operator:5.0.4-1978310 -p cockroachdb -c stable -e stable
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/cockroachdb/5.0.4/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=cockroachdb
--> Using cache 148bad8a91a0beb8625586963e4434807168790368841ec826d41641267e586d
--> 148bad8a91a
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=stable
--> Using cache 13381a1dc0b99d2a4d51c39855e82ecef63a8ee1e3590e68ce2d158d34e15c45
--> 13381a1dc0b
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
--> Using cache a33a67dc4ac39b68012f1013fd4f908d40ed95d6fef24ad586f35540d18de01e
--> a33a67dc4ac
STEP 8: COPY cockroachdb/5.0.4/manifests /manifests/
--> 883ab4d0255
STEP 9: COPY cockroachdb/5.0.4/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/cockroachdb-operator:5.0.4-1978310
--> 0df0c9e8ad8
0df0c9e8ad8783004f4da39c0695c06a8f438295427b8ee0f9aeeb870ece3e6a
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/cockroachdb-operator:5.0.4-1978310
Getting image source signatures
Copying blob 7a854bee6571 done  
Copying blob bd389be569b1 done  
Copying config 0df0c9e8ad done  
Writing manifest to image destination
Copying config 0df0c9e8ad [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# rm -fr bundle.Dockerfile cockroachdb/5.0.4/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# rm -fr cockroachdb/5.0.3/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]# rm -fr cockroachdb/5.0.4/metadata/annotations.yaml 
[root@preserve-olm-env 1978310]# touch cockroachdb/5.0.4/metadata/dependencies.yaml
[root@preserve-olm-env 1978310]# vi cockroachdb/5.0.4/metadata/dependencies.yaml
[root@preserve-olm-env 1978310]# cat cockroachdb/5.0.4/metadata/dependencies.yaml
dependencies:
- type: olm.package
  value:
    packageName: mta-operator
    version: "0.0.4"
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# ../../operator-framework-olm/bin/opm alpha bundle build -d cockroachdb/5.0.4/manifests -t quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep -p cockroachdb -c stable -e stable
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/cockroachdb/5.0.4/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=cockroachdb
--> Using cache 148bad8a91a0beb8625586963e4434807168790368841ec826d41641267e586d
--> 148bad8a91a
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=stable
--> Using cache 13381a1dc0b99d2a4d51c39855e82ecef63a8ee1e3590e68ce2d158d34e15c45
--> 13381a1dc0b
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
--> Using cache a33a67dc4ac39b68012f1013fd4f908d40ed95d6fef24ad586f35540d18de01e
--> a33a67dc4ac
STEP 8: COPY cockroachdb/5.0.4/manifests /manifests/
--> Using cache 883ab4d0255c8d954a3f95fdfc94bd41f0f061dc639c8e38f6c7c6fcd9e3c19e
--> 883ab4d0255
STEP 9: COPY cockroachdb/5.0.4/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep
--> d1408b6d2ec
d1408b6d2eca41726c88363736be471fcd26aa7177a0cb0ab75b89b6a76d4f12
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep
Getting image source signatures
Copying blob ecdb3e2f3ae9 done  
Copying blob bd389be569b1 skipped: already exists  
Copying config d1408b6d2e done  
Writing manifest to image destination
Copying config d1408b6d2e [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# ../../operator-framework-olm/bin/opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1978310,quay.io/olmqe/mta-operator:v0.0.5-1978310,quay.io/olmqe/cockroachdb-operator:5.0.3-1978310,quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep  -t quay.io/kuiwang/olm-index:1978310-twocatlog -c podman --mode semver
INFO[0000] building the index                            bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0000] running /usr/bin/podman pull quay.io/olmqe/mta-operator:v0.0.4-1978310  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0000] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0001] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0001] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0001] running /usr/bin/podman pull quay.io/olmqe/mta-operator:v0.0.5-1978310  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0002] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0002] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0003] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0003] running /usr/bin/podman pull quay.io/olmqe/cockroachdb-operator:5.0.3-1978310  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0004] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0004] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0004] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0004] running /usr/bin/podman pull quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0005] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0005] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0006] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0006] Could not find optional dependencies file     file=bundle_tmp617142142/metadata load=annotations with=bundle_tmp617142142
INFO[0006] Could not find optional properties file       file=bundle_tmp617142142/metadata load=annotations with=bundle_tmp617142142
INFO[0006] Could not find optional dependencies file     file=bundle_tmp569296581/metadata load=annotations with=bundle_tmp569296581
INFO[0006] Could not find optional properties file       file=bundle_tmp569296581/metadata load=annotations with=bundle_tmp569296581
INFO[0006] Could not find optional properties file       file=bundle_tmp554976096/metadata load=annotations with=bundle_tmp554976096
INFO[0006] Could not find optional properties file       file=bundle_tmp278640959/metadata load=annotations with=bundle_tmp278640959
INFO[0006] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0006] writing dockerfile: index.Dockerfile511482732  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0006] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
INFO[0006] [podman build --format docker -f index.Dockerfile511482732 -t quay.io/kuiwang/olm-index:1978310-twocatlog .]  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310 quay.io/olmqe/cockroachdb-operator:5.0.4-1978310-dep]"
[root@preserve-olm-env 1978310]# podman push quay.io/kuiwang/olm-index:1978310-twocatlog
Getting image source signatures
Copying blob 6a6923f3a3a5 done  
Copying blob 55dfd992c4eb skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying blob 88d2b1b8a4ca skipped: already exists  
Copying blob 094d78802b07 skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying config 29dbfb40ee done  
Writing manifest to image destination
Writing manifest to image destination
Storing signatures

[root@preserve-olm-env 1978310]# rm -fr cockroachdb/5.0.3/metadata/
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# ../../operator-framework-olm/bin/opm alpha bundle build -d cockroachdb/5.0.3/manifests -t quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep -p cockroachdb -c stable -e stable
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /data/kuiwang/cases/1978310/cockroachdb/5.0.3/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /data/kuiwang/cases/1978310 
INFO[0000] Building bundle image                        
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM scratch
STEP 2: LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
--> Using cache 15e491cc47a9fb627ddd7c5effb7b341ff133b96f54bed76c83a7cb13e4dc2cc
--> 15e491cc47a
STEP 3: LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
--> Using cache 918d57cf956eca34f6ae47c44994e428b91c6c49bb7170f86b903907df2a043d
--> 918d57cf956
STEP 4: LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
--> Using cache 2249aa186c06190044d49671ccfb7a809f2b9f55af6422fb30563b389e908f40
--> 2249aa186c0
STEP 5: LABEL operators.operatorframework.io.bundle.package.v1=cockroachdb
--> Using cache 148bad8a91a0beb8625586963e4434807168790368841ec826d41641267e586d
--> 148bad8a91a
STEP 6: LABEL operators.operatorframework.io.bundle.channels.v1=stable
--> Using cache 13381a1dc0b99d2a4d51c39855e82ecef63a8ee1e3590e68ce2d158d34e15c45
--> 13381a1dc0b
STEP 7: LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
--> Using cache a33a67dc4ac39b68012f1013fd4f908d40ed95d6fef24ad586f35540d18de01e
--> a33a67dc4ac
STEP 8: COPY cockroachdb/5.0.3/manifests /manifests/
--> Using cache e1e2bc9cd21df76e0dea7e7095eefad7610fecb537b2e0bc540b09b50c6b03ea
--> e1e2bc9cd21
STEP 9: COPY cockroachdb/5.0.3/metadata /metadata/
STEP 10: COMMIT quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep
--> b1d8305d649
b1d8305d64965cd0e41f6de98155bedba0d66f36513d5dd44f942182b0a5f05b
[root@preserve-olm-env 1978310]# podman push quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep
Getting image source signatures
Copying blob 5bc2a9b26d9f done  
Copying blob 2d855034f0b6 skipped: already exists  
Copying config b1d8305d64 done  
Writing manifest to image destination
Copying config b1d8305d64 [======================================] 2.1KiB / 2.1KiB
Writing manifest to image destination
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# ../../operator-framework-olm/bin/opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1978310,quay.io/olmqe/mta-operator:v0.0.5-1978310,quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep  -t quay.io/kuiwang/olm-index:1978310-onecatlog-nodep -c podman --mode semver
INFO[0000] building the index                            bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
...
INFO[0005] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
INFO[0005] writing dockerfile: index.Dockerfile093567112  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
INFO[0005] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
INFO[0005] [podman build --format docker -f index.Dockerfile093567112 -t quay.io/kuiwang/olm-index:1978310-onecatlog-nodep .]  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep]"
[root@preserve-olm-env 1978310]# podman push quay.io/kuiwang/olm-index:1978310-onecatlog-nodep
Getting image source signatures
Copying blob 2963a3fee415 done  
Copying blob 55dfd992c4eb skipped: already exists  
Copying blob 094d78802b07 skipped: already exists  
Copying blob 88d2b1b8a4ca skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying config 7e3d3014eb done  
Writing manifest to image destination
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# ../../operator-framework-olm/bin/opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1978310,quay.io/olmqe/mta-operator:v0.0.5-1978310,quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep,quay.io/olmqe/cockroachdb-operator:5.0.4-1978310  -t quay.io/kuiwang/olm-index:1978310-twocatlog-nodep -c podman --mode semver
...
INFO[0006] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
INFO[0006] writing dockerfile: index.Dockerfile782776307  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
INFO[0006] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
INFO[0006] [podman build --format docker -f index.Dockerfile782776307 -t quay.io/kuiwang/olm-index:1978310-twocatlog-nodep .]  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1978310 quay.io/olmqe/mta-operator:v0.0.5-1978310 quay.io/olmqe/cockroachdb-operator:5.0.3-1978310-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1978310]"
[root@preserve-olm-env 1978310]# podman push quay.io/kuiwang/olm-index:1978310-twocatlog-nodep
Getting image source signatures
Copying blob aca76cfc3aca done  
Copying blob 55dfd992c4eb skipped: already exists  
Copying blob 094d78802b07 skipped: already exists  
Copying blob 88d2b1b8a4ca skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying config a0cdbe2bec done  
Writing manifest to image destination
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env 1978310]# 



----

---- start to test scenario 1 which is OK----
[root@preserve-olm-env 1978310]# oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.9.0-0.nightly-2021-07-26-220837   True        False         7m8s    Cluster version is 4.9.0-0.nightly-2021-07-26-220837
[root@preserve-olm-env 1978310]#
[root@preserve-olm-env 1978310]# oc get pod -n openshift-operator-lifecycle-manager
NAME                                      READY   STATUS      RESTARTS   AGE
catalog-operator-5f49fb5c8d-wqbsj         1/1     Running     0          36m
collect-profiles-27122775-6rwrq           0/1     Completed   0          32m
collect-profiles-27122790-8xfqr           0/1     Completed   0          17m
collect-profiles-27122805-gdq5x           0/1     Completed   0          2m36s
olm-operator-5bfc4cfc4b-djbx7             1/1     Running     0          36m
package-server-manager-686844cb9b-gq9wq   1/1     Running     2          36m
packageserver-7cb76bc777-jv77b            1/1     Running     0          33m
packageserver-7cb76bc777-p99b9            1/1     Running     0          33m
[root@preserve-olm-env 1978310]# oc exec catalog-operator-5f49fb5c8d-wqbsj -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.18.3
git commit: 4a5ad031bf1e4888b01792f70a8c1a159719626b
[root@preserve-olm-env 1978310]# 


[root@preserve-olm-env 1978310]# cat og-single.yaml 
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single1
  namespace: default
spec:
  targetNamespaces:
  - default
[root@preserve-olm-env 1978310]# cat catsrc.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: cockroachdb-catalog
  namespace: default
spec:
  displayName: cockroachdb Operator Catalog
  image: quay.io/kuiwang/olm-index:1978310-onecatlog
  publisher: QE
  sourceType: grpc
  updateStrategy:
      registryPoll:
        interval: "2m0s"
[root@preserve-olm-env 1978310]# cat sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: cockroachdb
  namespace: default
spec:
  channel: stable
  installPlanApproval: Automatic
  name: cockroachdb
  source: cockroachdb-catalog
  sourceNamespace: default
[root@preserve-olm-env 1978310]# oc apply -f og-single.yaml
operatorgroup.operators.coreos.com/og-single1 created
[root@preserve-olm-env 1978310]# oc apply -f catsrc.yaml
catalogsource.operators.coreos.com/cockroachdb-catalog created
[root@preserve-olm-env 1978310]# oc apply -f sub.yaml 
subscription.operators.coreos.com/cockroachdb created
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# oc get sub
NAME                                             PACKAGE        SOURCE                CHANNEL
cockroachdb                                      cockroachdb    cockroachdb-catalog   stable
mta-operator-alpha-cockroachdb-catalog-default   mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                  APPROVAL    APPROVED
install-8lnfw   cockroachdb.v5.0.3   Automatic   true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Installing
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Installing
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# oc delete sub mta-operator-alpha-cockroachdb-catalog-default 
subscription.operators.coreos.com "mta-operator-alpha-cockroachdb-catalog-default" deleted
[root@preserve-olm-env 1978310]# oc delete sub cockroachdb
subscription.operators.coreos.com "cockroachdb" deleted
[root@preserve-olm-env 1978310]# oc delete csv windup-operator.0.0.4
clusterserviceversion.operators.coreos.com "windup-operator.0.0.4" deleted
[root@preserve-olm-env 1978310]# oc delete csv cockroachdb.v5.0.3
clusterserviceversion.operators.coreos.com "cockroachdb.v5.0.3" deleted
[root@preserve-olm-env 1978310]# 
----

---- continue to test scenario 2 OK ---
[root@preserve-olm-env 1978310]# cat sub-manual.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: cockroachdb
  namespace: default
spec:
  channel: stable
  installPlanApproval: Manual
  name: cockroachdb
  source: cockroachdb-catalog
  sourceNamespace: default
[root@preserve-olm-env 1978310]# oc apply -f sub-manual.yaml 
subscription.operators.coreos.com/cockroachdb created
[root@preserve-olm-env 1978310]# oc get sub
NAME          PACKAGE       SOURCE                CHANNEL
cockroachdb   cockroachdb   cockroachdb-catalog   stable
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-7wf8b   windup-operator.0.0.4   Manual     false
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-rt4bm   windup-operator.0.0.4   Manual     false
[root@preserve-olm-env 1978310]# oc edit ip install-rt4bm
installplan.operators.coreos.com/install-rt4bm edited
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-rt4bm   windup-operator.0.0.4   Manual     true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# 


[root@preserve-olm-env 1978310]# oc get catsrc
NAME                  DISPLAY                        TYPE   PUBLISHER   AGE
cockroachdb-catalog   cockroachdb Operator Catalog   grpc   QE          15m
[root@preserve-olm-env 1978310]# oc edit catsrc cockroachdb-catalog
catalogsource.operators.coreos.com/cockroachdb-catalog edited 
//change index from quay.io/kuiwang/olm-index:1978310-onecatlog to quay.io/kuiwang/olm-index:1978310-twocatlog
//to upgrade cockroachdb to 5.0.4 and still expect to keep windup-operator as 0.0.4
[root@preserve-olm-env 1978310]#

[root@preserve-olm-env 1978310]# oc get sub
NAME                                             PACKAGE        SOURCE                CHANNEL
cockroachdb                                      cockroachdb    cockroachdb-catalog   stable
mta-operator-alpha-cockroachdb-catalog-default   mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-rt4bm   windup-operator.0.0.4   Manual     true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-b6nx2   cockroachdb.v5.0.4      Manual     false
install-rt4bm   windup-operator.0.0.4   Manual     true
[root@preserve-olm-env 1978310]# oc edit ip install-b6nx2
installplan.operators.coreos.com/install-b6nx2 edited
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL   APPROVED
install-b6nx2   cockroachdb.v5.0.4      Manual     true
install-rt4bm   windup-operator.0.0.4   Manual     true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES             PHASE
cockroachdb.v5.0.4      CockroachDB Helm Operator                     5.0.4     cockroachdb.v5.0.3   Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                          Succeeded
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# oc delete sub mta-operator-alpha-cockroachdb-catalog-default
subscription.operators.coreos.com "mta-operator-alpha-cockroachdb-catalog-default" deleted
[root@preserve-olm-env 1978310]# oc delete sub cockroachdb
subscription.operators.coreos.com "cockroachdb" deleted
[root@preserve-olm-env 1978310]# oc delete csv windup-operator.0.0.4
clusterserviceversion.operators.coreos.com "windup-operator.0.0.4" deleted
[root@preserve-olm-env 1978310]# oc delete csv cockroachdb.v5.0.4
clusterserviceversion.operators.coreos.com "cockroachdb.v5.0.4" deleted
[root@preserve-olm-env 1978310]# oc delete catsrc cockroachdb-catalog
catalogsource.operators.coreos.com "cockroachdb-catalog" deleted
[root@preserve-olm-env 1978310]# 


---

---continue to test scenario 3 which is expected after talking with dev---
[root@preserve-olm-env 1978310]# cat catsrc-nodep.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: cockroachdb-catalog
  namespace: default
spec:
  displayName: cockroachdb Operator Catalog
  image: quay.io/kuiwang/olm-index:1978310-onecatlog-nodep
  publisher: QE
  sourceType: grpc
  updateStrategy:
      registryPoll:
        interval: "2m0s"
[root@preserve-olm-env 1978310]# cat sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: cockroachdb
  namespace: default
spec:
  channel: stable
  installPlanApproval: Automatic
  name: cockroachdb
  source: cockroachdb-catalog
  sourceNamespace: default
[root@preserve-olm-env 1978310]# cat mta-sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: mta
  namespace: default
spec:
  channel: alpha
  installPlanApproval: Manual
  name: mta-operator
  source: cockroachdb-catalog
  sourceNamespace: default
  startingCSV: "windup-operator.0.0.4"
[root@preserve-olm-env 1978310]# oc apply -f catsrc-nodep.yaml 
catalogsource.operators.coreos.com/cockroachdb-catalog created
[root@preserve-olm-env 1978310]# oc apply -f sub.yaml 
subscription.operators.coreos.com/cockroachdb created
[root@preserve-olm-env 1978310]# oc apply -f mta-sub.yaml 
subscription.operators.coreos.com/mta created
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# oc get sub
NAME          PACKAGE        SOURCE                CHANNEL
cockroachdb   cockroachdb    cockroachdb-catalog   stable
mta           mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      false
[root@preserve-olm-env 1978310]# oc edit ip install-wzgzn
installplan.operators.coreos.com/install-wzgzn edited
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      false
[root@preserve-olm-env 1978310]# 

[root@preserve-olm-env 1978310]# oc get catsrc
NAME                  DISPLAY                        TYPE   PUBLISHER   AGE
cockroachdb-catalog   cockroachdb Operator Catalog   grpc   QE          2m20s
[root@preserve-olm-env 1978310]# oc edit catsrc cockroachdb-catalog
catalogsource.operators.coreos.com/cockroachdb-catalog edited
// change quay.io/kuiwang/olm-index:1978310-onecatlog-nodep to quay.io/kuiwang/olm-index:1978310-twocatlog-nodep
[root@preserve-olm-env 1978310]# oc get sub
NAME          PACKAGE        SOURCE                CHANNEL
cockroachdb   cockroachdb    cockroachdb-catalog   stable
mta           mta-operator   cockroachdb-catalog   alpha
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      false
// cockroachdb reuse mta's ip, so we have to approve mta's ip although sub cockroachdb is automatic approval.
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES   PHASE
cockroachdb.v5.0.3      CockroachDB                                   5.0.3                Succeeded
windup-operator.0.0.4   Migration Toolkit for Applications Operator   0.0.4                Succeeded
[root@preserve-olm-env 1978310]# 
[root@preserve-olm-env 1978310]# oc edit ip install-xg7m7
installplan.operators.coreos.com/install-xg7m7 edited
// approve ip
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      true
install-xq5wz   cockroachdb.v5.0.4      Manual      false
// cockroachdb should be automatic, but here it become manual
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      true
install-xq5wz   cockroachdb.v5.0.4      Manual      false
[root@preserve-olm-env 1978310]# oc get ip install-xq5wz 
NAME            CSV                  APPROVAL   APPROVED
install-xq5wz   cockroachdb.v5.0.4   Manual     false
[root@preserve-olm-env 1978310]# oc edit ip install-xq5wz
installplan.operators.coreos.com/install-xq5wz edited
[root@preserve-olm-env 1978310]# oc get ip
NAME            CSV                     APPROVAL    APPROVED
install-qfjh9   cockroachdb.v5.0.3      Automatic   true
install-wzgzn   windup-operator.0.0.4   Manual      true
install-xg7m7   windup-operator.0.0.5   Manual      true
install-xq5wz   cockroachdb.v5.0.4      Manual      true
[root@preserve-olm-env 1978310]# oc get csv
NAME                    DISPLAY                                       VERSION   REPLACES                PHASE
cockroachdb.v5.0.4      CockroachDB Helm Operator                     5.0.4     cockroachdb.v5.0.3      Succeeded
windup-operator.0.0.5   Migration Toolkit for Applications Operator   0.0.5     windup-operator.0.0.4   Succeeded
[root@preserve-olm-env 1978310]# 

---

Comment 15 errata-xmlrpc 2021-10-18 17:37:30 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.9.0 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-2021:3759