Bug 1989796 - the same bundle is in output of opm alpha diff
Summary: the same bundle is in output of opm alpha diff
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.9
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.9.0
Assignee: Eric Stroczynski
QA Contact: kuiwang
URL: https://github.com/openshift/operator...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-04 02:57 UTC by kuiwang
Modified: 2021-10-18 17:44 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:44:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift operator-framework-olm pull 163 0 None None None 2021-08-11 20:38:06 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:44:37 UTC

Description kuiwang 2021-08-04 02:57:51 UTC
Description of problem:
We have bundle images:
quay.io/olmqe/mta-operator:v0.0.4-1869
quay.io/olmqe/mta-operator:v0.0.5-1869
quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep
quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep
quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep

and we make index-1 with 
quay.io/olmqe/mta-operator:v0.0.4-1869
quay.io/olmqe/mta-operator:v0.0.5-1869
quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep

opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1869,quay.io/olmqe/mta-operator:v0.0.5-1869,quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep -t quay.io/kuiwang/olm-index:OLM-1869-latest-1 -c podman --mode semver

and then we make index-2-1 with
quay.io/olmqe/mta-operator:v0.0.5-1869
quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep
quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep
quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep

opm index add -b quay.io/olmqe/mta-operator:v0.0.5-1869,quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep,quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep,quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep -t quay.io/kuiwang/olm-index:OLM-1869-latest-2-1 -c podman --mode semver


when opm alpha diff index-1 and index-2-1, we expect the following in output:
cockroachdb-operator:5.0.4
buildv2-operator:0.3.0

but the following are also in the output which is not expected:
mta-operator:v0.0.5
cockroachdb-operator:5.0.3


Version-Release number of selected component (if applicable):
[root@preserve-olm-env OSDK-1869]# opm version
Version: version.Version{OpmVersion:"06abc61a5", GitCommit:"06abc61a5a013c1a82941516f2f1a00c9c03d4b7", BuildDate:"2021-08-04T01:28:28Z", GoOs:"linux", GoArch:"amd64"}
[root@preserve-olm-env OSDK-1869]# 


How reproducible:
Always

Steps to Reproduce:
1. make index image
----
[root@preserve-olm-env OSDK-1869]# opm index add -b quay.io/olmqe/mta-operator:v0.0.4-1869,quay.io/olmqe/mta-operator:v0.0.5-1869,quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep -t quay.io/kuiwang/olm-index:OLM-1869-latest-1 -c podman --mode semver
INFO[0000] building the index                            bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0000] running /usr/bin/podman pull quay.io/olmqe/mta-operator:v0.0.4-1869  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0001] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0001] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0001] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0001] running /usr/bin/podman pull quay.io/olmqe/mta-operator:v0.0.5-1869  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0002] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0003] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0003] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0003] running /usr/bin/podman pull quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0004] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0004] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0005] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0005] Could not find optional dependencies file     file=bundle_tmp756432992/metadata load=annotations with=bundle_tmp756432992
INFO[0005] Could not find optional properties file       file=bundle_tmp756432992/metadata load=annotations with=bundle_tmp756432992
INFO[0005] Could not find optional dependencies file     file=bundle_tmp120854079/metadata load=annotations with=bundle_tmp120854079
INFO[0005] Could not find optional properties file       file=bundle_tmp120854079/metadata load=annotations with=bundle_tmp120854079
INFO[0005] Could not find optional dependencies file     file=bundle_tmp014576786/metadata load=annotations with=bundle_tmp014576786
INFO[0005] Could not find optional properties file       file=bundle_tmp014576786/metadata load=annotations with=bundle_tmp014576786
INFO[0005] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0005] writing dockerfile: index.Dockerfile502628478  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0005] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
INFO[0005] [podman build --format docker -f index.Dockerfile502628478 -t quay.io/kuiwang/olm-index:OLM-1869-latest-1 .]  bundles="[quay.io/olmqe/mta-operator:v0.0.4-1869 quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep]"
[root@preserve-olm-env OSDK-1869]# podman push quay.io/kuiwang/olm-index:OLM-1869-latest-1
Getting image source signatures
Copying blob 9d672dbf5b35 done  
Copying blob 0a2e14525df4 skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying blob 88d2b1b8a4ca skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying blob 643830e90a15 skipped: already exists  
Copying config a7fe5c99bd done  
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env OSDK-1869]# 

[root@preserve-olm-env OSDK-1869]# opm index add -b quay.io/olmqe/mta-operator:v0.0.5-1869,quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep,quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep,quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep -t quay.io/kuiwang/olm-index:OLM-1869-latest-2-1 -c podman --mode semver
INFO[0000] building the index                            bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0000] running /usr/bin/podman pull quay.io/olmqe/mta-operator:v0.0.5-1869  bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0001] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0001] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0002] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0002] running /usr/bin/podman pull quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep  bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0003] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0003] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0003] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0004] running /usr/bin/podman pull quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep  bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0005] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0005] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0005] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0005] running /usr/bin/podman pull quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep  bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0006] running podman create                         bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0006] running podman cp                             bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0007] running podman rm                             bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0007] Could not find optional dependencies file     file=bundle_tmp708443238/metadata load=annotations with=bundle_tmp708443238
INFO[0007] Could not find optional properties file       file=bundle_tmp708443238/metadata load=annotations with=bundle_tmp708443238
INFO[0007] Could not find optional dependencies file     file=bundle_tmp237814925/metadata load=annotations with=bundle_tmp237814925
INFO[0007] Could not find optional properties file       file=bundle_tmp237814925/metadata load=annotations with=bundle_tmp237814925
INFO[0007] Could not find optional dependencies file     file=bundle_tmp989171848/metadata load=annotations with=bundle_tmp989171848
INFO[0007] Could not find optional properties file       file=bundle_tmp989171848/metadata load=annotations with=bundle_tmp989171848
INFO[0007] Could not find optional dependencies file     file=bundle_tmp175504967/metadata load=annotations with=bundle_tmp175504967
INFO[0007] Could not find optional properties file       file=bundle_tmp175504967/metadata load=annotations with=bundle_tmp175504967
INFO[0007] Generating dockerfile                         bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0007] writing dockerfile: index.Dockerfile822183444  bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0007] running podman build                          bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
INFO[0007] [podman build --format docker -f index.Dockerfile822183444 -t quay.io/kuiwang/olm-index:OLM-1869-latest-2-1 .]  bundles="[quay.io/olmqe/mta-operator:v0.0.5-1869 quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep]"
[root@preserve-olm-env OSDK-1869]# podman push quay.io/kuiwang/olm-index:OLM-1869-latest-2-1
Getting image source signatures
Copying blob c25ff74c46f6 done  
Copying blob 0a2e14525df4 skipped: already exists  
Copying blob 72e830a4dff5 skipped: already exists  
Copying blob 06888ef1f8b7 skipped: already exists  
Copying blob 88d2b1b8a4ca skipped: already exists  
Copying blob 643830e90a15 skipped: already exists  
Copying config 52c4b669d3 done  
Writing manifest to image destination
Storing signatures
[root@preserve-olm-env OSDK-1869]# 
----
2. opm alpha diff
----
[root@preserve-olm-env OSDK-1869]# opm alpha diff quay.io/kuiwang/olm-index:OLM-1869-latest-1 quay.io/kuiwang/olm-index:OLM-1869-latest-2-1 > index-diff-1-2-1.yaml
WARN[0001] {"created":"2021-08-04T02:01:06.409577148Z","container":"c4a0650a20951bb3a7b95e3e5a7dcd6044855b5975367b54417be82b5f5bab80","container_config":{"Hostname":"295d9d9e7387","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"ExposedPorts":{"50051/tcp":{}},"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["registry","serve","--database","/database/index.db"],"Image":"sha256:217ec0897103aae8cae9b328b6fff47e7563130899f6f0ab79a9847d73df3ce1","Volumes":{},"WorkingDir":"","Entrypoint":["/bin/opm"],"OnBuild":[],"Labels":{"io.buildah.version":"1.19.8","operators.operatorframework.io.index.database.v1":"/database/index.db"}},"config":{"Hostname":"295d9d9e7387","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"ExposedPorts":{"50051/tcp":{}},"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["registry","serve","--database","/database/index.db"],"Image":"sha256:217ec0897103aae8cae9b328b6fff47e7563130899f6f0ab79a9847d73df3ce1","Volumes":{},"WorkingDir":"","Entrypoint":["/bin/opm"],"OnBuild":[],"Labels":{"io.buildah.version":"1.19.8","operators.operatorframework.io.index.database.v1":"/database/index.db"}},"architecture":"amd64","os":"linux","parent":"sha256:cd4e53ba263a02aa866513a22cedbc39db0952b5bc9896e1fe5bb3a55683a45f","rootfs":{"type":"layers","diff_ids":["sha256:72e830a4dff5f0d5225cdc0a320e85ab1ce06ea5673acfe8d83a7645cbd0e9cf","sha256:06888ef1f8b7f623a02c4644133575d65f2268aeec60d414ec39f2eff42dbde8","sha256:88d2b1b8a4ca16f518cd7192a28a67b005c8529a8f12d9116b69995e9c5b7c2c","sha256:0a2e14525df4bb9e255569d67dd6026642a8b790fc3b809fe8fb1798c706e139","sha256:643830e90a1537ca7ba595c79c795596976f5125cc8d5823c329bbd710afb65a","sha256:9d672dbf5b356480eb568624ac8144f11b945132866659339047b89e7cd9c312"]},"history":[{"created":"2021-06-15T22:19:37.639998211Z","created_by":"/bin/sh -c #(nop) ADD file:f278386b0cef68136129f5f58c52445590a417b624d62bca158d4dc926c340df in / "},{"created":"2021-06-15T22:19:37.842991933Z","created_by":"/bin/sh -c #(nop)  CMD [\"/bin/sh\"]","empty_layer":true},{"created":"2021-07-09T19:45:58.319270715Z","created_by":"/bin/sh -c apk update \u0026\u0026 apk add ca-certificates"},{"created":"2021-07-09T19:45:58.473605179Z","created_by":"/bin/sh -c #(nop) COPY file:d059a61e5fe70800aab11fbc409c1e5e191b9f484f20f506ef2a6ffca1b10fc6 in /etc/nsswitch.conf "},{"created":"2021-07-29T20:02:26.500711281Z","created_by":"/bin/sh -c #(nop) COPY file:a880bcf19f98bf22241d8339b613da74d2cfa4fb482d8e4587144f939d36be5c in /bin/opm "},{"created":"2021-07-29T20:02:27.017766763Z","created_by":"/bin/sh -c #(nop) COPY file:d152b88c7d1e4f825edb1173337c2994c80fce349331e1378947a054943f0c10 in /bin/grpc_health_probe "},{"created":"2021-07-30T08:36:37.112299754Z","created_by":"/bin/sh -c #(nop) LABEL operators.operatorframework.io.index.database.v1=/database/index.db","empty_layer":true},{"created":"2021-08-04T02:01:06.000287839Z","created_by":"/bin/sh -c #(nop) ADD file:1144421384d9fcd04b2a9d6b459cf93f63063fc0891f5bb3a5fb4e5efbf5a337 in /database/index.db "},{"created":"2021-08-04T02:01:06.223444131Z","created_by":"/bin/sh -c #(nop) EXPOSE 50051","empty_layer":true},{"created":"2021-08-04T02:01:06.315661628Z","created_by":"/bin/sh -c #(nop) ENTRYPOINT [\"/bin/opm\"]","empty_layer":true},{"created":"2021-08-04T02:01:06.409886447Z","created_by":"/bin/sh -c #(nop) CMD [\"registry\", \"serve\", \"--database\", \"/database/index.db\"]","empty_layer":true}]} 
WARN[0002] {"created":"2021-08-04T02:35:01.173878967Z","container":"16959b351bbc74c6b2429d44003f3573f9d406143e16a44e79a897cdce001b46","container_config":{"Hostname":"33ce609ff3c4","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"ExposedPorts":{"50051/tcp":{}},"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["registry","serve","--database","/database/index.db"],"Image":"sha256:217ec0897103aae8cae9b328b6fff47e7563130899f6f0ab79a9847d73df3ce1","Volumes":{},"WorkingDir":"","Entrypoint":["/bin/opm"],"OnBuild":[],"Labels":{"io.buildah.version":"1.19.8","operators.operatorframework.io.index.database.v1":"/database/index.db"}},"config":{"Hostname":"33ce609ff3c4","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"ExposedPorts":{"50051/tcp":{}},"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["registry","serve","--database","/database/index.db"],"Image":"sha256:217ec0897103aae8cae9b328b6fff47e7563130899f6f0ab79a9847d73df3ce1","Volumes":{},"WorkingDir":"","Entrypoint":["/bin/opm"],"OnBuild":[],"Labels":{"io.buildah.version":"1.19.8","operators.operatorframework.io.index.database.v1":"/database/index.db"}},"architecture":"amd64","os":"linux","parent":"sha256:6fbf05ea79b8570bb5bbfcc7c952eccc19a617dfc58c686d8ebf3d4d045ee201","rootfs":{"type":"layers","diff_ids":["sha256:72e830a4dff5f0d5225cdc0a320e85ab1ce06ea5673acfe8d83a7645cbd0e9cf","sha256:06888ef1f8b7f623a02c4644133575d65f2268aeec60d414ec39f2eff42dbde8","sha256:88d2b1b8a4ca16f518cd7192a28a67b005c8529a8f12d9116b69995e9c5b7c2c","sha256:0a2e14525df4bb9e255569d67dd6026642a8b790fc3b809fe8fb1798c706e139","sha256:643830e90a1537ca7ba595c79c795596976f5125cc8d5823c329bbd710afb65a","sha256:c25ff74c46f65ca03e260b71763aceee4e5769ba1cc5e71aeedd6b108d778efe"]},"history":[{"created":"2021-06-15T22:19:37.639998211Z","created_by":"/bin/sh -c #(nop) ADD file:f278386b0cef68136129f5f58c52445590a417b624d62bca158d4dc926c340df in / "},{"created":"2021-06-15T22:19:37.842991933Z","created_by":"/bin/sh -c #(nop)  CMD [\"/bin/sh\"]","empty_layer":true},{"created":"2021-07-09T19:45:58.319270715Z","created_by":"/bin/sh -c apk update \u0026\u0026 apk add ca-certificates"},{"created":"2021-07-09T19:45:58.473605179Z","created_by":"/bin/sh -c #(nop) COPY file:d059a61e5fe70800aab11fbc409c1e5e191b9f484f20f506ef2a6ffca1b10fc6 in /etc/nsswitch.conf "},{"created":"2021-07-29T20:02:26.500711281Z","created_by":"/bin/sh -c #(nop) COPY file:a880bcf19f98bf22241d8339b613da74d2cfa4fb482d8e4587144f939d36be5c in /bin/opm "},{"created":"2021-07-29T20:02:27.017766763Z","created_by":"/bin/sh -c #(nop) COPY file:d152b88c7d1e4f825edb1173337c2994c80fce349331e1378947a054943f0c10 in /bin/grpc_health_probe "},{"created":"2021-07-30T08:36:37.112299754Z","created_by":"/bin/sh -c #(nop) LABEL operators.operatorframework.io.index.database.v1=/database/index.db","empty_layer":true},{"created":"2021-08-04T02:35:00.000264012Z","created_by":"/bin/sh -c #(nop) ADD file:217a56d1f3aab49de3a9b7aa13609347ce6cf42975bfa4aaf0ba41f8a85c3628 in /database/index.db "},{"created":"2021-08-04T02:35:00.474044121Z","created_by":"/bin/sh -c #(nop) EXPOSE 50051","empty_layer":true},{"created":"2021-08-04T02:35:00.82003586Z","created_by":"/bin/sh -c #(nop) ENTRYPOINT [\"/bin/opm\"]","empty_layer":true},{"created":"2021-08-04T02:35:01.174199618Z","created_by":"/bin/sh -c #(nop) CMD [\"registry\", \"serve\", \"--database\", \"/database/index.db\"]","empty_layer":true}]} 

----
3. check result. Note: edit the file to reduce the data in file.
----
[root@preserve-olm-env OSDK-1869]# vi index-diff-1-2-1.yaml
[root@preserve-olm-env OSDK-1869]# cat index-diff-1-2-1.yaml
---
defaultChannel: alpha
icon:
  mediatype: image/png
name: buildv2-operator
schema: olm.package
---
image: quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep
name: buildv2-operator.v0.3.0
package: buildv2-operator
properties:
- type: olm.bundle.object
  value:
- type: olm.bundle.object
  value:
- type: olm.bundle.object
  value:
- type: olm.bundle.object
  value:
- type: olm.bundle.object
  value:
- type: olm.channel
  value:
    name: alpha
- type: olm.gvk
  value:
    group: build.dev
    kind: Build
    version: v1alpha1
- type: olm.gvk
  value:
    group: build.dev
    kind: BuildRun
    version: v1alpha1
- type: olm.gvk
  value:
    group: build.dev
    kind: BuildStrategy
    version: v1alpha1
- type: olm.gvk
  value:
    group: build.dev
    kind: ClusterBuildStrategy
    version: v1alpha1
- type: olm.gvk.required
  value:
    group: operator.tekton.dev
    kind: TektonConfig
    version: v1alpha1
- type: olm.package
  value:
    packageName: buildv2-operator
    version: 0.3.0
relatedImages:
- image: quay.io/shipwright/shipwright-operator:v0.3.0
  name: ""
- image: quay.io/olmqe/buildv2-operator:0.3.0-1869-nodep
  name: ""
schema: olm.bundle
---
defaultChannel: stable
icon:
  mediatype: image/svg+xml
name: cockroachdb
schema: olm.package
---
image: quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep
name: cockroachdb.v5.0.3
package: cockroachdb
properties:
- type: olm.channel
  value:
    name: stable
- type: olm.gvk
  value:
    group: charts.operatorhub.io
    kind: Cockroachdb
    version: v1alpha1
- type: olm.package
  value:
    packageName: cockroachdb
    version: 5.0.3
relatedImages:
- image: quay.io/olmqe/cockroachdb-operator:5.0.3-1869-nodep
  name: ""
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
  name: ""
- image: quay.io/helmoperators/cockroachdb:v5.0.3
  name: ""
schema: olm.bundle
---
image: quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep
name: cockroachdb.v5.0.4
package: cockroachdb
properties:
- type: olm.bundle.object
  value:
- type: olm.bundle.object
  value:
- type: olm.bundle.object
  value:
- type: olm.bundle.object
  value:
- type: olm.channel
  value:
    name: stable
    replaces: cockroachdb.v5.0.3
- type: olm.gvk
  value:
    group: charts.operatorhub.io
    kind: Cockroachdb
    version: v1alpha1
- type: olm.package
  value:
    packageName: cockroachdb
    version: 5.0.4
relatedImages:
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
  name: ""
- image: quay.io/olmqe/cockroachdb-operator:5.0.4-1869-nodep
  name: ""
- image: quay.io/helmoperators/cockroachdb:v5.0.4
  name: ""
schema: olm.bundle
---
defaultChannel: alpha
icon:
  mediatype: image/png
name: mta-operator
schema: olm.package
---
image: quay.io/olmqe/mta-operator:v0.0.5-1869
name: windup-operator.0.0.5
package: mta-operator
properties:
- type: olm.bundle.object
  value:
- type: olm.bundle.object
  value:
- type: olm.channel
  value:
    name: alpha
- type: olm.gvk
  value:
    group: windup.jboss.org
    kind: Windup
    version: v1
- type: olm.package
  value:
    packageName: mta-operator
    version: 0.0.5
relatedImages:
- image: quay.io/olmqe/mta-operator:v0.0.5-1869
  name: ""
- image: quay.io/windupeng/windup-operator-native:0.0.5
  name: ""
schema: olm.bundle

----

Actual results:
mta-operator:v0.0.5
cockroachdb-operator:5.0.3
exist

Expected results:
should no
mta-operator:v0.0.5
cockroachdb-operator:5.0.3


Additional info:

Comment 1 Joe Lanford 2021-08-04 15:52:20 UTC
As I understand `opm diff`, it will include full bundles in the output if anything is different for those bundles between each index.

I expect that mta-operator:v0.0.5 showed up in the diff because it replaces v0.0.4 in index-1, but not in index-2-1
I expect that cockroachdb-operator:5.0.3 showed up in the diff because it has olm.bundle.object properties in index-1, but not in index-2-1

Comment 2 Eric Stroczynski 2021-08-04 16:56:32 UTC
@jlanford is correct, as per the enhancement proposal: https://github.com/operator-framework/enhancements/blob/master/enhancements/catalog-data-transfer-reduction.md#diff-algorithm

However the command docs say only bundles not in the old ref are included, so I'll update them to reflect reality.

Comment 4 kuiwang 2021-08-05 05:34:52 UTC
@estroczy, thanks for clarification

Now https://github.com/operator-framework/operator-registry/pull/735 is in upstream
Please make it merged in downstream, and I will change it to verified.

Thanks

Comment 5 kuiwang 2021-08-10 00:50:13 UTC
We need to the fix on downstream and then verify it.
Now the fix is not on downstream, so change it back to Assigned.

Comment 7 kuiwang 2021-08-16 01:44:21 UTC
verified. LGTM

--
[root@preserve-olm-env operator-framework-olm]# opm alpha diff --help
Diff a set of old and new catalog references ("refs") to produce a declarative config containing only packages channels, and versions not present in the old set, and versions that differ between the old and new sets. This is known as "latest" mode. These references are passed through 'opm render' to produce a single declarative config.

[root@preserve-olm-env operator-framework-olm]# opm version
Version: version.Version{OpmVersion:"edcddea0f", GitCommit:"edcddea0f2b6344bc388b746078d6ae81dfbf1f8", BuildDate:"2021-08-16T01:32:12Z", GoOs:"linux", GoArch:"amd64"}
[root@preserve-olm-env operator-framework-olm]# 
--

Comment 10 errata-xmlrpc 2021-10-18 17:44:27 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


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