Bug 1902803 - ListBundles returns incorrect replaces/skips when bundles have been added via semver-skippatch mode
Summary: ListBundles returns incorrect replaces/skips when bundles have been added via...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.5.z
Assignee: Evan Cordell
QA Contact: kuiwang
URL:
Whiteboard:
Depends On: 1892360
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-30 18:06 UTC by Ben Luddy
Modified: 2020-12-15 20:28 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1892360
Environment:
Last Closed: 2020-12-15 20:28:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-registry pull 524 0 None open Bug 1902803: Reconstruct replaces/splits for Listbundles from channel_entry. 2020-11-30 21:19:11 UTC
Red Hat Product Errata RHSA-2020:5359 0 None None None 2020-12-15 20:28:59 UTC

Comment 2 kuiwang 2020-12-03 07:48:15 UTC
verify it on 4.5. LGTM

--
[root@preserve-olm-env operator-registry]# git log -n 1
commit 8501e18da61d3fbd8e7d06dc6d777837203d7b1d
Merge: 7416454 2ea11ef
Author: OpenShift Merge Robot <openshift-merge-robot.github.com>
Date:   Wed Dec 2 22:44:24 2020 +0100

    Merge pull request #524 from benluddy/backport-520-to-45
    
    Bug 1902803: Reconstruct replaces/splits for Listbundles from channel_entry.
[root@preserve-olm-env operator-registry]# make clean
[root@preserve-olm-env operator-registry]# make build
GOFLAGS="-mod=vendor" go build  -o bin/appregistry-server ./cmd/appregistry-server
GOFLAGS="-mod=vendor" go build  -o bin/configmap-server ./cmd/configmap-server
GOFLAGS="-mod=vendor" go build  -o bin/initializer ./cmd/initializer
GOFLAGS="-mod=vendor" go build  -o bin/registry-server ./cmd/registry-server
GOFLAGS="-mod=vendor" go build -ldflags "-X 'github.com/operator-framework/operator-registry/cmd/opm/version.gitCommit=8501e18' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=1.12.3' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2020-12-03T05:50:48Z'"  -o bin/opm ./cmd/opm
[root@preserve-olm-env operator-registry]# 

[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1889388/0.3.0 --tag quay.io/kuiwang/teiid-operator:v1902803-3 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Building Dockerfile                          
INFO[0000] Building bundle image                        
Sending build context to Docker daemon  113.8MB
Step 1/9 : FROM scratch
 ---> 
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> 17f4d6cc02f6
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> ed5b62e609a0
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 958a7490fbd5
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Using cache
 ---> 660a23efdfcf
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Using cache
 ---> c841860d7e05
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Using cache
 ---> add28127624d
Step 8/9 : COPY manifests/teiid-1889388/0.3.0 /manifests/
 ---> Using cache
 ---> 6096d94be701
Step 9/9 : COPY manifests/teiid-1889388/metadata /metadata/
 ---> Using cache
 ---> e9c83c0e1a57
Successfully built e9c83c0e1a57
Successfully tagged quay.io/kuiwang/teiid-operator:v1902803-3

[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v1902803-3
The push refers to repository [quay.io/kuiwang/teiid-operator]
1b01392952df: Layer already exists 
079b420c77c5: Layer already exists 
v1902803-3: digest: sha256:99d74b55abafd57bd4762987ca834aeb158b8c6e18f83611326e2ac086de8186 size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/teiid-1889388/metadata/
[root@preserve-olm-env operator-registry]# 

[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1889388/0.4.0 --tag quay.io/kuiwang/teiid-operator:v1902803-4 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Building Dockerfile                          
INFO[0000] Building bundle image                        
Sending build context to Docker daemon  113.8MB
Step 1/9 : FROM scratch
 ---> 
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> 17f4d6cc02f6
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> ed5b62e609a0
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 958a7490fbd5
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Using cache
 ---> 660a23efdfcf
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Using cache
 ---> c841860d7e05
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Using cache
 ---> add28127624d
Step 8/9 : COPY manifests/teiid-1889388/0.4.0 /manifests/
 ---> Using cache
 ---> 13bdfcea5ee9
Step 9/9 : COPY manifests/teiid-1889388/metadata /metadata/
 ---> Using cache
 ---> ec71510339c5
Successfully built ec71510339c5
Successfully tagged quay.io/kuiwang/teiid-operator:v1902803-4
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v1902803-4
The push refers to repository [quay.io/kuiwang/teiid-operator]
88a40f8ae5bd: Layer already exists 
96f88f344c1a: Layer already exists 
v1902803-4: digest: sha256:288c57d56d0f67ca8ed241608c6e6cf76cba1f0c81ec012b8b1a43aecba66ae9 size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/teiid-1889388/metadata/
[root@preserve-olm-env operator-registry]# 


[root@preserve-olm-env operator-registry]# docker pull quay.io/operator-framework/upstream-opm-builder:latest
latest: Pulling from operator-framework/upstream-opm-builder
188c0c94c7c5: Already exists 
0b204e20a8c1: Already exists 
e83dfb2924e7: Already exists 
5d1ab5675176: Pull complete 
7452e4c67cbe: Pull complete 
Digest: sha256:6bc1f9808358939873445098f8387f903490d0cd7218f93c302d3c82b5febfb3
Status: Downloaded newer image for quay.io/operator-framework/upstream-opm-builder:latest
quay.io/operator-framework/upstream-opm-builder:latest
[root@preserve-olm-env operator-registry]# docker pull quay.io/operator-framework/upstream-registry-builder:latest
latest: Pulling from operator-framework/upstream-registry-builder
188c0c94c7c5: Already exists 
538011b74a72: Already exists 
f165f470e2ae: Already exists 
eca759a32715: Pull complete 
Digest: sha256:9dc08e1ff6ebe81e0040d01cd7e1fe60d0c3ff605b8d8198e19ffb78e7ee6523
Status: Downloaded newer image for quay.io/operator-framework/upstream-registry-builder:latest
quay.io/operator-framework/upstream-registry-builder:latest
[root@preserve-olm-env operator-registry]# 


[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v1902803-3 --tag quay.io/kuiwang/teiid-index:1902803 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v1902803-3]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v1902803-3  bundles="[quay.io/kuiwang/teiid-operator:v1902803-3]"
INFO[0000] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v1902803-3]"
INFO[0000] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v1902803-3]"
INFO[0000] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v1902803-3]"
INFO[0001] Could not find optional dependencies file     dir=bundle_tmp304558239 file=bundle_tmp304558239/metadata load=annotations
INFO[0001] found csv, loading bundle                     dir=bundle_tmp304558239 file=bundle_tmp304558239/manifests load=bundle
INFO[0001] loading bundle file                           dir=bundle_tmp304558239/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0001] loading bundle file                           dir=bundle_tmp304558239/manifests file=teiid.v0.3.0.clusterserviceversion.yaml load=bundle
INFO[0001] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v1902803-3]"
INFO[0001] writing dockerfile: index.Dockerfile048839461  bundles="[quay.io/kuiwang/teiid-operator:v1902803-3]"
INFO[0001] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v1902803-3]"
INFO[0001] [docker build -f index.Dockerfile048839461 -t quay.io/kuiwang/teiid-index:1902803 .]  bundles="[quay.io/kuiwang/teiid-operator:v1902803-3]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1902803
The push refers to repository [quay.io/kuiwang/teiid-index]
3c11d84be009: Pushed 
5fc241497410: Mounted from operator-framework/upstream-opm-builder 
318814b08d6d: Mounted from operator-framework/upstream-opm-builder 
371d4702865c: Layer already exists 
4570b0d18853: Layer already exists 
ace0eda3e3be: Layer already exists 
1902803: digest: sha256:014b82c9e804ac647948baf1a42d0464bd27390a01916daba546ecde6c7b3509 size: 1578
[root@preserve-olm-env operator-registry]# 
[root@preserve-olm-env operator-registry]# 
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v1902803-4 --from-index quay.io/kuiwang/teiid-index:1902803 --tag quay.io/kuiwang/teiid-index:1902803 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0000] Pulling previous image quay.io/kuiwang/teiid-index:1902803 to get metadata  bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1902803  bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1902803  bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0001] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v1902803-4  bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0002] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0002] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0002] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0002] Could not find optional dependencies file     dir=bundle_tmp988728676 file=bundle_tmp988728676/metadata load=annotations
INFO[0002] found csv, loading bundle                     dir=bundle_tmp988728676 file=bundle_tmp988728676/manifests load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp988728676/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp988728676/manifests file=teiid.v0.4.0.clusterserviceversion.yaml load=bundle
INFO[0002] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0002] writing dockerfile: index.Dockerfile883992034  bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0002] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
INFO[0002] [docker build -f index.Dockerfile883992034 -t quay.io/kuiwang/teiid-index:1902803 .]  bundles="[quay.io/kuiwang/teiid-operator:v1902803-4]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1902803
The push refers to repository [quay.io/kuiwang/teiid-index]
62a4e12f2bb5: Pushed 
5fc241497410: Layer already exists 
318814b08d6d: Layer already exists 
371d4702865c: Layer already exists 
4570b0d18853: Layer already exists 
ace0eda3e3be: Layer already exists 
1902803: digest: sha256:d5c8ab3dd754e1aebb23f4f24147bb9ddd6f64c95adb369b85f3724ae78dc51b size: 1578
[root@preserve-olm-env operator-registry]# 


[root@preserve-olm-env 1902803]# oc get pod -n openshift-operator-lifecycle-manager
NAME                                READY   STATUS    RESTARTS   AGE
catalog-operator-6cfd494fd8-cmjt5   1/1     Running   0          40m
olm-operator-757898b8c6-6d8l7       1/1     Running   0          40m
packageserver-79bcc8cf98-bxb4v      1/1     Running   0          30m
packageserver-79bcc8cf98-qn5mf      1/1     Running   0          30m
[root@preserve-olm-env 1902803]# oc exec catalog-operator-6cfd494fd8-cmjt5 -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.15.1
git commit: fa71ab38bea652e03006d2df77b66058f3ff6c60
[root@preserve-olm-env 1902803]# cat teiidcatsrc.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: teiid
  namespace: default
spec:
  displayName: "teiid Operators"
  image: quay.io/kuiwang/teiid-index:1902803
  publisher: QE
  sourceType: grpc
[root@preserve-olm-env 1902803]# oc apply -f teiidcatsrc.yaml
catalogsource.operators.coreos.com/teiid created
[root@preserve-olm-env 1902803]# oc get pod
NAME          READY   STATUS    RESTARTS   AGE
teiid-lxqk4   0/1     Running   0          12s
[root@preserve-olm-env 1902803]# oc get pod
NAME          READY   STATUS    RESTARTS   AGE
teiid-lxqk4   1/1     Running   0          19s
[root@preserve-olm-env 1902803]# cat og-single.yaml 
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single1
  namespace: default
spec:
  targetNamespaces:
  - default
[root@preserve-olm-env 1902803]# oc apply -f og-single.yaml 
operatorgroup.operators.coreos.com/og-single1 created
[root@preserve-olm-env 1902803]# 
[root@preserve-olm-env 1902803]# 
[root@preserve-olm-env 1902803]# cat teiidsub.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: teiid
  namespace: default
spec:
  source: teiid
  sourceNamespace: default

  channel: beta
  installPlanApproval: Automatic
  name: teiid
  startingCSV: teiid.v0.3.0
[root@preserve-olm-env 1902803]# oc apply -f teiidsub.yaml
subscription.operators.coreos.com/teiid created
[root@preserve-olm-env 1902803]# oc get sub
NAME    PACKAGE   SOURCE   CHANNEL
teiid   teiid     teiid    beta
[root@preserve-olm-env 1902803]# oc get ip
NAME            CSV            APPROVAL    APPROVED
install-wtkgk   teiid.v0.3.0   Automatic   true
[root@preserve-olm-env 1902803]# oc get csv
NAME           DISPLAY   VERSION   REPLACES   PHASE
teiid.v0.3.0   Teiid     0.3.0                Installing
[root@preserve-olm-env 1902803]# oc get csv
NAME           DISPLAY   VERSION   REPLACES       PHASE
teiid.v0.4.0   Teiid     0.4.0     teiid.v0.3.0   Succeeded
[root@preserve-olm-env 1902803]# 



--

Comment 5 errata-xmlrpc 2020-12-15 20:28:46 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.5.23 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5359


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