Bug 1829832
| Summary: | oc adm catalog mirror produces an empty db and list of images when mirroring an index image (vs an image built with oc adm catalog build) | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | lgallett |
| Component: | OLM | Assignee: | Evan Cordell <ecordell> |
| OLM sub component: | OLM | QA Contact: | Jian Zhang <jiazha> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | high | ||
| Priority: | urgent | CC: | manoj.paladiya, shurley |
| Version: | 4.5 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.5.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-07-13 17:33:40 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: | |||
|
Description
lgallett
2020-04-30 13:00:36 UTC
A workaround for anyone hitting this issue with an index image (i.e. the database is stored at `/database/index.db`: ``` $ oc adm catalog mirror <catalog> <mirror target> --path="/database/index.db:./" --manifests-only --dry-run $ mv index.db bundles.db $ oc adm catalog mirror <catalog> <mirror target> --path="/database/index.db:./" ``` *** Bug 1828816 has been marked as a duplicate of this bug. *** 1, use the oc client with fixed PR merged in.
[root@preserve-olm-env data]# ./oc version -o yaml
clientVersion:
buildDate: "2020-05-27T18:28:54Z"
compiler: gc
gitCommit: 06cc74b10770e609b99c0be95284331c94b14d85
gitTreeState: dirty
gitVersion: openshift-clients-4.5.0-202005271737
goVersion: go1.13.4
major: ""
minor: ""
platform: linux/amd64
openshiftVersion: 4.5.0-0.nightly-2020-05-27-202943
...
2, dry-run the mirror:
[root@preserve-olm-env data]# ./oc adm catalog mirror --insecure quay.io/galletti94/redhat-operators-index:v4.5 localhost:5000 --manifests-only
src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/175145052
wrote database to /tmp/175145052
using database at: /tmp/175145052/index.db
no digest mapping available for registry-proxy-stage.engineering.redhat.com/rh-osbs-stage/e2e-e2e-test-rhel8-operator:8.0-350, skip writing to ImageContentSourcePolicy
no digest mapping available for registry-proxy.engineering.redhat.com/rh-osbs/openshift-service-mesh-kiali-operator-metadata:1.0-7, skip writing to ImageContentSourcePolicy
no digest mapping available for registry-proxy.engineering.redhat.com/rh-osbs/amq7-amq-streams-rhel7-operator-metadata:1.1.0-1, skip writing to ImageContentSourcePolicy
no digest mapping available for registry.access.redhat.com/amqstreams-1/amqstreams10-clusteroperator-openshift:1.0.0, skip writing to ImageContentSourcePolicy
no digest mapping available for registry.stage.redhat.io/openshift-service-mesh/kiali-rhel7-operator:1.0.5, skip writing to ImageContentSourcePolicy
no digest mapping available for registry.redhat.io/amq7/amq-streams-operator:1.3.0, skip writing to ImageContentSourcePolicy
no digest mapping available for registry.access.redhat.com/amq7/amq-streams-cluster-operator:1.1.0, skip writing to ImageContentSourcePolicy
no digest mapping available for registry-proxy.engineering.redhat.com/rh-osbs/amq7-amq-streams-rhel7-operator-metadata:1.4.0-1, skip writing to ImageContentSourcePolicy
no digest mapping available for registry-proxy.engineering.redhat.com/rh-osbs/amq7-amq-streams-rhel7-operator-metadata:1.3.0-1, skip writing to ImageContentSourcePolicy
no digest mapping available for registry-proxy.engineering.redhat.com/rh-osbs/amq7-amq-streams-rhel7-operator-metadata:1.2.0-1, skip writing to ImageContentSourcePolicy
no digest mapping available for registry.redhat.io/amq7/amq-streams-operator:1.2.0, skip writing to ImageContentSourcePolicy
no digest mapping available for registry-proxy.engineering.redhat.com/rh-osbs/lgallett-bundle:v1.1-14, skip writing to ImageContentSourcePolicy
no digest mapping available for registry-proxy.engineering.redhat.com/rh-osbs/amq7-amq-streams-rhel7-operator-metadata:1.0.0-1, skip writing to ImageContentSourcePolicy
wrote mirroring manifests to Redhat-operators-index-manifests
3, Check the generated database and ICSP files.
[root@preserve-olm-env data]# cat redhat-operators-index-manifests/imageContentSourcePolicy.yaml
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
name: redhat-operators-index
spec:
repositoryDigestMirrors:
- mirrors:
- localhost:5000/rhcam-1-1/openshift-migration-velero-rhel8
source: image-registry.openshift-image-registry.svc:5000/rhcam-1-1/openshift-migration-velero-rhel8@sha256:db2997115d8a0767d61038e14f48170dc53d3c54b977184e7ecb37ead2f131da
- mirrors:
- localhost:5000/openshift4/ose-elasticsearch-operator
source: registry.redhat.io/openshift4/ose-elasticsearch-operator@sha256:fce8d14e89b49c3b4cbeba27b0005ec8887a91b4a711fadbb2201cf03de43dea
- mirrors:
...
[root@preserve-olm-env data]# sqlite3 /tmp/175145052/index.db
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .header on
sqlite> .mode column
sqlite> .table
api channel operatorbundle schema_migrations
api_provider channel_entry package
api_requirer dependencies related_image
sqlite> select * from channel;
name package_name head_operatorbundle_name
---------- ----------------- ------------------------------------
4.3 e2e-test-operator e2e-test-operator.4.3.1-202002032140
stable amq-streams amqstreams.v1.4.0
release-v1 cam-operator cam-operator.v1.1.0
stable kiali-ossm kiali-operator.v1.0.5
sqlite> select * from related_image;
image operatorbundle_name
--------------------------------------------------------------------------------------------- ------------------------------------
registry.redhat.io/openshift4/ose-elasticsearch-operator@sha256:fce8d14e89b49c3b4cbeba27b0005ec8887a91b4a711fadbb2201cf03de43dea e2e-test-operator.4.3.1-202002032140
registry.redhat.io/openshift4/ose-logging-elasticsearch5@sha256:52a806ed9e97476fdcf15199d2c3e1c6185ebad25deb0445bae5abbabd794c4a e2e-test-operator.4.3.1-202002032140
registry.redhat.io/openshift4/ose-oauth-proxy@sha256:c51acb965b18ca94ec4dde07b5726f90174d569eb34ac4a7bd79cf71a63dec98 e2e-test-operator.4.3.1-202002032140
...
LGTM, verify it.
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 |