Bug 1904547 - Bundle images should be persisted to related_image table in registry database but are not
Summary: Bundle images should be persisted to related_image table in registry database...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: x86_64
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 4.6.z
Assignee: Ben Luddy
QA Contact: kuiwang
URL:
Whiteboard:
Depends On: 1895367
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-04 18:00 UTC by Ben Luddy
Modified: 2022-10-11 06:35 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1895367
Environment:
Last Closed: 2021-01-25 20:02:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-registry pull 532 0 None closed Bug 1904547: Include the bundle image itself as a related image. 2021-02-15 08:55:46 UTC
Red Hat Product Errata RHSA-2021:0171 0 None None None 2021-01-25 20:02:34 UTC

Internal Links: 1928858

Comment 3 kuiwang 2021-01-18 06:13:20 UTC
verify it on 4.6. LGTM

--
[root@preserve-olm-env operator-registry]# git log -n 1
commit 33f1688e66420b26aa3d36b1e12d0c3fdc31bbea
Merge: e86c799 cbfe5c0
Author: OpenShift Merge Robot <openshift-merge-robot.github.com>
Date:   Fri Jan 15 17:39:33 2021 -0500

    Merge pull request #532 from benluddy/backport-527
    
    Bug 1904547: Include the bundle image itself as a related image.
[root@preserve-olm-env operator-registry]# make clean;make build
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/appregistry-server ./cmd/appregistry-server
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/configmap-server ./cmd/configmap-server
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/initializer ./cmd/initializer
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/registry-server ./cmd/registry-server
GOFLAGS="-mod=vendor" go build -ldflags "-X 'github.com/operator-framework/operator-registry/cmd/opm/version.gitCommit=33f1688' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=v1.14.3-24-g33f1688' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2021-01-18T05:19:40Z'"  -tags "json1" -o bin/opm ./cmd/opm
[root@preserve-olm-env operator-registry]# 


[root@preserve-olm-env operator-registry]# docker build -t opm46 .
Sending build context to Docker daemon  126.9MB
Step 1/22 : FROM registry.svc.ci.openshift.org/ocp/builder:rhel-8-golang-openshift-4.6 as builder
 ---> 358e4291a9e6
Step 2/22 : ENV GOPATH /go
 ---> Running in af13b5fea558
Removing intermediate container af13b5fea558
 ---> 8fa0cb624e45
Step 3/22 : ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
 ---> Running in ef33d32046a4
Removing intermediate container ef33d32046a4
 ---> 5ac911f1d311
Step 4/22 : WORKDIR /src
 ---> Running in 40f809a3203d
Removing intermediate container 40f809a3203d
 ---> 63b054962b2a
Step 5/22 : COPY vendor vendor
 ---> fdcb97f1d629
Step 6/22 : COPY cmd cmd
 ---> b5ff7cbfe3ca
Step 7/22 : COPY pkg pkg
 ---> f91dbd323afd
Step 8/22 : COPY Makefile go.mod go.sum ./
 ---> b1d156e26454
Step 9/22 : RUN make build cross
 ---> Running in ce300adfc248
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/appregistry-server ./cmd/appregistry-server
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/configmap-server ./cmd/configmap-server
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/initializer ./cmd/initializer
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/registry-server ./cmd/registry-server
GOFLAGS="-mod=vendor" go build -ldflags "-X 'github.com/operator-framework/operator-registry/cmd/opm/version.gitCommit=' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2021-01-18T05:49:08Z'"  -tags "json1" -o bin/opm ./cmd/opm
GOOS=darwin CC=o64-clang CXX=o64-clang++ CGO_ENABLED=1 GOFLAGS="-mod=vendor" go build -ldflags "-X 'github.com/operator-framework/operator-registry/cmd/opm/version.gitCommit=' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2021-01-18T05:49:08Z'" -tags "json1" -o "bin/darwin-amd64-opm" --ldflags "-extld=o64-clang" ./cmd/opm
GOOS=windows CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_ENABLED=1 GOFLAGS="-mod=vendor" go build -ldflags "-X 'github.com/operator-framework/operator-registry/cmd/opm/version.gitCommit=' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2021-01-18T05:49:08Z'" -tags "json1"  -o "bin/windows-amd64-opm" --ldflags "-extld=x86_64-w64-mingw32-gcc" ./cmd/opm
Removing intermediate container ce300adfc248
 ---> abd2d6fabec7
Step 10/22 : RUN CGO_ENABLED=0 go build -mod=vendor -tags netgo -ldflags "-w" ./vendor/github.com/grpc-ecosystem/grpc-health-probe/...
 ---> Running in d14b158eabc3
Removing intermediate container d14b158eabc3
 ---> be9781df11f4
Step 11/22 : FROM registry.svc.ci.openshift.org/ocp/4.6:base
 ---> f71dc5e3c4e4
Step 12/22 : COPY --from=builder /src/bin/* /tmp/bin/
 ---> 2d12a8345ba1
Step 13/22 : COPY --from=builder /src/grpc-health-probe /bin/grpc_health_probe
 ---> 9d9dd33bd907
Step 14/22 : RUN cp -avr /tmp/bin/. /bin/
 ---> Running in dfaa53d96e2b
'/tmp/bin/./appregistry-server' -> '/bin/./appregistry-server'
'/tmp/bin/./configmap-server' -> '/bin/./configmap-server'
'/tmp/bin/./darwin-amd64-opm' -> '/bin/./darwin-amd64-opm'
'/tmp/bin/./initializer' -> '/bin/./initializer'
'/tmp/bin/./opm' -> '/bin/./opm'
'/tmp/bin/./registry-server' -> '/bin/./registry-server'
'/tmp/bin/./windows-amd64-opm' -> '/bin/./windows-amd64-opm'
Removing intermediate container dfaa53d96e2b
 ---> 5b9510af6eb1
Step 15/22 : RUN mkdir /registry
 ---> Running in ce83904ce412
Removing intermediate container ce83904ce412
 ---> 79f2a992183d
Step 16/22 : RUN chgrp -R 0 /registry &&     chmod -R g+rwx /registry
 ---> Running in b712f2fe7471
Removing intermediate container b712f2fe7471
 ---> 8bd70c448dca
Step 17/22 : WORKDIR /registry
 ---> Running in a8b2dc2cff95
Removing intermediate container a8b2dc2cff95
 ---> f1d9a4c1782f
Step 18/22 : USER 1001
 ---> Running in 5310a44bc665
Removing intermediate container 5310a44bc665
 ---> d696cd6a88b9
Step 19/22 : EXPOSE 50051
 ---> Running in 3c2249bfbadc
Removing intermediate container 3c2249bfbadc
 ---> e55f10a3cc42
Step 20/22 : ENTRYPOINT ["/bin/registry-server"]
 ---> Running in 5bcacdd44d4f
Removing intermediate container 5bcacdd44d4f
 ---> f07e9c5284e4
Step 21/22 : CMD ["--database", "/bundles.db"]
 ---> Running in 46065e6cf54b
Removing intermediate container 46065e6cf54b
 ---> 5f53c1bfb085
Step 22/22 : LABEL io.k8s.display-name="OpenShift Operator Registry"       io.k8s.description="This is a component of OpenShift Operator Lifecycle Manager and is the base for operator catalog API containers."       maintainer="Odin Team <aos-odin>"       summary="Operator Registry runs in a Kubernetes or OpenShift cluster to provide operator catalog data to Operator Lifecycle Manager."
 ---> Running in ee384c9d55cb
Removing intermediate container ee384c9d55cb
 ---> 802217fb4901
Successfully built 802217fb4901
Successfully tagged opm46:latest
[root@preserve-olm-env operator-registry]# 
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v1898500-3 --tag quay.io/kuiwang/teiid-index:1904547 -c docker -i opm46:latest
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v1898500-3]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v1898500-3  bundles="[quay.io/kuiwang/teiid-operator:v1898500-3]"
INFO[0000] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v1898500-3]"
INFO[0000] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v1898500-3]"
INFO[0000] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v1898500-3]"
INFO[0000] Could not find optional dependencies file     dir=bundle_tmp985350128 file=bundle_tmp985350128/metadata load=annotations
INFO[0000] found csv, loading bundle                     dir=bundle_tmp985350128 file=bundle_tmp985350128/manifests load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp985350128/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp985350128/manifests file=teiid.v0.3.0.clusterserviceversion.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp985350128/manifests file=teiid_service.yaml load=bundle
INFO[0000] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v1898500-3]"
INFO[0000] writing dockerfile: index.Dockerfile302412686  bundles="[quay.io/kuiwang/teiid-operator:v1898500-3]"
INFO[0000] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v1898500-3]"
INFO[0000] [docker build -f index.Dockerfile302412686 -t quay.io/kuiwang/teiid-index:1904547 .]  bundles="[quay.io/kuiwang/teiid-operator:v1898500-3]"

[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1904547
The push refers to repository [quay.io/kuiwang/teiid-index]
acf3b1a9438a: Pushed 
e09b3b28a115: Pushed 
1b56d61373c7: Pushed 
4c27bf2310a5: Pushed 
7463e6b74a8a: Pushed 
9a9bf76ac356: Pushed 
6eb13983b44d: Pushed 
aa98cc9662d1: Pushed 
0c4ff9d6cafd: Pushed 
96c54a12373b: Pushed 
c483fe8f3e2d: Pushed 
1904547: digest: sha256:003ae7b6edb1b34558702f5c20f541b16903517d7f9c931874aa32e8e060e268 size: 2630

[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v1898500-4 --from-index quay.io/kuiwang/teiid-index:1904547 --tag  quay.io/kuiwang/teiid-index:1904547 -c docker
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0000] Pulling previous image quay.io/kuiwang/teiid-index:1904547 to get metadata  bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1904547  bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1904547  bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0004] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0005] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v1898500-4  bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0006] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0007] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0007] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0007] Could not find optional dependencies file     dir=bundle_tmp118169567 file=bundle_tmp118169567/metadata load=annotations
INFO[0007] found csv, loading bundle                     dir=bundle_tmp118169567 file=bundle_tmp118169567/manifests load=bundle
INFO[0007] loading bundle file                           dir=bundle_tmp118169567/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0007] loading bundle file                           dir=bundle_tmp118169567/manifests file=teiid.v0.4.0.clusterserviceversion.yaml load=bundle
INFO[0007] loading bundle file                           dir=bundle_tmp118169567/manifests file=teiid_service.yaml load=bundle
INFO[0007] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0007] writing dockerfile: index.Dockerfile384583269  bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0007] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
INFO[0007] [docker build -f index.Dockerfile384583269 -t quay.io/kuiwang/teiid-index:1904547 .]  bundles="[quay.io/kuiwang/teiid-operator:v1898500-4]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1904547
The push refers to repository [quay.io/kuiwang/teiid-index]
6700c4697749: Pushed 
802407fa13c4: Mounted from kuiwang/cockroachdb-index 
e8f1c61aaad9: Mounted from kuiwang/cockroachdb-index 
f3c6434dd07c: Mounted from kuiwang/cockroachdb-index 
770f842146c0: Mounted from kuiwang/cockroachdb-index 
777b2c648970: Mounted from kuiwang/cockroachdb-index 
1904547: digest: sha256:05ea8e91739c0e14e04360583578487f00417f699ac097874847bcaa50426fa8 size: 1578
[root@preserve-olm-env operator-registry]# 

[root@preserve-olm-env operator-registry]# docker create quay.io/kuiwang/teiid-index:1904547
7a66202c0fb47688c6ac4540c036b052541d966db3abd5fcd641f38142bef23c
[root@preserve-olm-env operator-registry]# docker cp 7a66202c0fb47688c6ac4540c036b052541d966db3abd5fcd641f38142bef23c:/database/index.db .
[root@preserve-olm-env operator-registry]# sqlite3 index.db 'select * from related_image;'
quay.io/kuiwang/teiid-operator:v1898500-3|teiid.v0.3.0
quay.io/teiid/teiid-operator:0.3.0|teiid.v0.3.0
quay.io/kuiwang/teiid-operator:v1898500-4|teiid.v0.4.0
quay.io/teiid/teiid-operator:0.4.0|teiid.v0.4.0
[root@preserve-olm-env operator-registry]# docker rm 7a66202c0fb47688c6ac4540c036b052541d966db3abd5fcd641f38142bef23c
7a66202c0fb47688c6ac4540c036b052541d966db3abd5fcd641f38142bef23c
[root@preserve-olm-env operator-registry]# 


##here quay.io/kuiwang/teiid-operator:v1898500-3 and quay.io/kuiwang/teiid-operator:v1898500-4 are bundle image
--

Comment 6 errata-xmlrpc 2021-01-25 20:02:12 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.6.13 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:0171


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