Bug 1829994 - opm index add fails when using digests in bundle image references and podman as a container tool
Summary: opm index add fails when using digests in bundle image references and podman ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.5
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: ---
: 4.5.0
Assignee: Kevin Rizza
QA Contact: yhui
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-30 17:13 UTC by lgallett
Modified: 2020-07-13 17:33 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-13 17:33:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-registry pull 314 0 None closed Bug 1829994: Index generate dameonless 2021-02-15 09:54:37 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:33:59 UTC

Description lgallett 2020-04-30 17:13:53 UTC
Description of problem:

podman save does not support using digests (https://github.com/containers/libpod/issues/5234)

meaning opm (which calls podman save by default) fails when using digests.


Version-Release number of selected component (if applicable):


How reproducible:

always


Steps to Reproduce:
1. use sha in bundle images to add to an index

Actual results:

opm index add command fails

Expected results:

opm index add command succeeds


Additional info:

Comment 3 yhui 2020-05-08 08:28:01 UTC
Version-Release number of selected component (if applicable):
Latest master branch opm
[root@preserve-olm-env operator-registry]# git clone https://github.com/operator-framework/operator-registry/
[root@preserve-olm-env operator-registry]# git log
commit 57fa57773011730379dd9e38507036cfd4377bcf
Merge: 0121e48 689410c
Author: OpenShift Merge Robot <openshift-merge-robot.github.com>
Date:   Thu May 7 16:54:19 2020 +0200

    Merge pull request #318 from Bowenislandsong/bug/understandsingBundles1827723
    
    Bug 1827723: Make default channel optional

commit 689410ce8f7005dd273c9ba86a521914433afda1
Author: bowenislandsong <bsong>
Date:   Thu May 7 09:23:59 2020 -0400

    Make default channel optional
    
    This commit leaves default channel blank if not specified or is not contained in channels. This affects the `annotations.yaml` and m


Steps to test:
1. use sha in bundle images to add to an index

[root@preserve-olm-env operator-registry]# /root/hui/operator-registry/opm index add -b quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a -t quay.io/yuhui12/etcd-bundle-test:1 -p podman

INFO[0000] building the index                            bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
INFO[0000] running /usr/bin/podman pull quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a  bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
INFO[0001] running /usr/bin/podman pull quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a  bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
INFO[0003] running podman save                           bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
ERRO[0003] Error: error getting Docker archive ImageReference for "bundle_staging_955905512/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a": docker-archive doesn't support digest references: bundle_staging_955905512/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a  bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
ERRO[0003] permissive mode disabled                      bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]" error="error loading bundle from image: error saving image: Error: error getting Docker archive ImageReference for \"bundle_staging_955905512/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a\": docker-archive doesn't support digest references: bundle_staging_955905512/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a\n. exit status 125"
Error: error loading bundle from image: error saving image: Error: error getting Docker archive ImageReference for "bundle_staging_955905512/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a": docker-archive doesn't support digest references: bundle_staging_955905512/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a
. exit status 125

Actual results:
opm index add command fails
Error: error getting Docker archive ImageReference for "bundle_staging_955905512/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a": docker-archive doesn't support digest references:

Expected results:
opm index add command succeeds

Comment 5 yhui 2020-05-09 06:45:05 UTC
Hi Kevin,

Thanks for your detailed info. It's clear now.

Version-Release number of selected component (if applicable):
Latest master branch opm
[root@preserve-olm-env operator-registry]# git clone https://github.com/operator-framework/operator-registry/
[root@preserve-olm-env operator-registry]# git log
commit 57fa57773011730379dd9e38507036cfd4377bcf
Merge: 0121e48 689410c
Author: OpenShift Merge Robot <openshift-merge-robot.github.com>
Date:   Thu May 7 16:54:19 2020 +0200

    Merge pull request #318 from Bowenislandsong/bug/understandsingBundles1827723
    
    Bug 1827723: Make default channel optional

commit 689410ce8f7005dd273c9ba86a521914433afda1
Author: bowenislandsong <bsong>
Date:   Thu May 7 09:23:59 2020 -0400

    Make default channel optional
    
    This commit leaves default channel blank if not specified or is not contained in channels. This affects the `annotations.yaml` and m


Steps to test:
1. use sha in bundle images to add to an index
$ opm index add -b quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a -p podman --generate
INFO[0000] building the index                            bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
INFO[0000] running /usr/bin/podman pull quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a  bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
INFO[0002] running /usr/bin/podman pull quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a  bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
INFO[0003] running podman save                           bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
ERRO[0003] Error: error getting Docker archive ImageReference for "bundle_staging_136185834/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a": docker-archive doesn't support digest references: bundle_staging_136185834/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a  bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
ERRO[0003] permissive mode disabled                      bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]" error="error loading bundle from image: error saving image: Error: error getting Docker archive ImageReference for \"bundle_staging_136185834/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a\": docker-archive doesn't support digest references: bundle_staging_136185834/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a\n. exit status 125"
Error: error loading bundle from image: error saving image: Error: error getting Docker archive ImageReference for "bundle_staging_136185834/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a": docker-archive doesn't support digest references: bundle_staging_136185834/bundle.tar:quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a
. exit status 125

There is an error. Please help to check it. Thanks.

Comment 7 yhui 2020-05-11 10:17:02 UTC
Hi Kevin,

Thanks for your reply. It resolved my confuse.

Version-Release number of selected component (if applicable):
Latest master branch opm

Steps to test:
1. use sha in bundle images to add to an index
[root@preserve-olm-env hui]# /root/hui/operator-registry/opm index add -b quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a -p none --generate
INFO[0000] building the index                            bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
INFO[0000] resolved name: quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a 
INFO[0000] fetched                                       digest="sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a"
INFO[0000] fetched                                       digest="sha256:0fe93b63574622a71d20e741e349c1fbc5603f761cfd292b28060a8e4d57847f"
INFO[0000] fetched                                       digest="sha256:d76c7299ec538d477355de5202ce803a40c4427f8aaead494a56e6d49dd59677"
INFO[0000] fetched                                       digest="sha256:29c4a0adedee3d5e8c4038dde67151aab2feecca6aea9422dfc1b82775f53b43"
INFO[0000] unpacking layer: {application/vnd.docker.image.rootfs.diff.tar.gzip sha256:d76c7299ec538d477355de5202ce803a40c4427f8aaead494a56e6d49dd59677 8029 [] map[] <nil>} 
INFO[0000] unpacking layer: {application/vnd.docker.image.rootfs.diff.tar.gzip sha256:0fe93b63574622a71d20e741e349c1fbc5603f761cfd292b28060a8e4d57847f 280 [] map[] <nil>} 
INFO[0000] Could not find optional dependencies file     dir=bundle_tmp523375362 file=bundle_tmp523375362/metadata load=annotations
INFO[0000] found csv, loading bundle                     dir=bundle_tmp523375362 file=bundle_tmp523375362/manifests load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp523375362/manifests file=etcdbackups.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp523375362/manifests file=etcdclusters.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp523375362/manifests file=etcdoperator.v0.9.0.clusterserviceversion.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp523375362/manifests file=etcdrestores.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0000] Generating dockerfile                         bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"
INFO[0000] writing dockerfile: index.Dockerfile          bundles="[quay.io/yuhui12/etcd-bundle@sha256:d00732b4f12757c7d95f2c8f30b22a4083dec048b5b3799fb5af0232a2440d1a]"

2. use podman to build image
[root@preserve-olm-env hui]# podman build -f index.Dockerfile -t quay.io/yuhui12/etcd-bundle-test:1 .
STEP 1: FROM quay.io/operator-framework/upstream-opm-builder
STEP 2: LABEL operators.operatorframework.io.index.database.v1=/database/index.db
05d1902f1d069f3ef2b1cbcd857eb0371a38f9932d8f72a4cd59155d50598cb4
STEP 3: ADD database/index.db /database/index.db
0d9828914733e02084af6759faeb9cd7b466b3297dd62d1787fd50d32fcb1277
STEP 4: EXPOSE 50051
15d57d1e731b1069d182f923e4b143cefceb9fa36a23ebce02d3450e92fc74bc
STEP 5: ENTRYPOINT ["/bin/opm"]
f97c687725e6bd1035990e7433ee45c4f1496904e4a455c5773361c6e2327b51
STEP 6: CMD ["registry", "serve", "--database", "/database/index.db"]
STEP 7: COMMIT quay.io/yuhui12/etcd-bundle-test:1
0b7777ccb60cadcbb6028cda00df4a38de1de57df52702d9e35f285461b9390c

3. Check the image is created successfully.
[root@preserve-olm-env hui]# podman images --digests
REPOSITORY                                        TAG       DIGEST                                                                    IMAGE ID       CREATED         SIZE
quay.io/yuhui12/etcd-bundle-test                  1                                                                                   0b7777ccb60c   4 seconds ago   57 MB

Verify the bug.

Comment 8 errata-xmlrpc 2020-07-13 17:33:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHBA-2020:2409


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