Bug 1917549 - Failed to mirror operator catalog - error: destination registry required
Summary: Failed to mirror operator catalog - error: destination registry required
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.6.z
Assignee: Kevin Rizza
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On: 1902299
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-18 17:35 UTC by OpenShift BugZilla Robot
Modified: 2021-02-08 13:51 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-08 13:51:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 711 0 None closed Bug 1917548: 4.6 backports for oc adm catalog mirror 2021-02-05 18:34:22 UTC
Red Hat Product Errata RHSA-2021:0308 0 None None None 2021-02-08 13:51:43 UTC

Comment 2 Jian Zhang 2021-02-01 01:42:05 UTC
1, Install the `oc` that contains the fixed PR, as follows:
[root@preserve-olm-env 4.6]# ./oc version -o yaml
clientVersion:
  buildDate: "2021-01-30T16:34:42Z"
  compiler: gc
  gitCommit: 18d7461aca47e77cefb355339252a8d4c149188f
  gitTreeState: clean
  gitVersion: 4.6.0-202101301510.p0-18d7461
  goVersion: go1.15.5
  major: ""
  minor: ""
  platform: linux/amd64
releaseClientVersion: 4.6.0-0.nightly-2021-01-30-211400
...

2, Run `oc adm catalog mirror` command to mirror the images to the registry directly.
[root@preserve-olm-env 4.6]# ./oc adm catalog mirror quay.io/openshift-qe-optional-operators/ocp4-index:latest localhost:5000 --manifests-only
src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/145875005
wrote database to /tmp/145875005
using database at: /tmp/145875005/index.db
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.access.redhat.com/amqstreams-1/amqstreams10-clusteroperator-openshift:1.0.0, 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 quay.io/openshift-qe-optional-operators/ocp4-index:latest, skip writing to ImageContentSourcePolicy
no digest mapping available for registry.redhat.io/amq7/amq-streams-operator:1.2.0, skip writing to ImageContentSourcePolicy
wrote mirroring manifests to manifests-ocp4-index-1612142459
[root@preserve-olm-env 4.6]# tree manifests-ocp4-index-1612142459/
manifests-ocp4-index-1612142459/
├── catalogSource.yaml
├── imageContentSourcePolicy.yaml
└── mapping.txt

0 directories, 3 files

[root@preserve-olm-env 4.6]# cat manifests-ocp4-index-1612142459/catalogSource.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: ocp4-index
  namespace: openshift-marketplace
spec:
  image: localhost:5000/openshift-qe-optional-operators/ocp4-index:latest
  sourceType: grpc
[root@preserve-olm-env 4.6]# cat manifests-ocp4-index-1612142459/imageContentSourcePolicy.yaml 
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  name: ocp4-index
spec:
  repositoryDigestMirrors:
  - mirrors:
    - localhost:5000/openshift4/ose-elasticsearch-operator
    source: registry.redhat.io/openshift4/ose-elasticsearch-operator
...

There is no panic, and the destination registry/repo looks good.

3, mirror the images to the same repo of the registry, it works well too.
[root@preserve-olm-env 4.6]# ./oc adm catalog mirror quay.io/openshift-qe-optional-operators/ocp4-index:latest localhost:5000/test --manifests-only
src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/857592508
wrote database to /tmp/857592508
using database at: /tmp/857592508/index.db
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 quay.io/openshift-qe-optional-operators/ocp4-index:latest, 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.redhat.io/amq7/amq-streams-operator:1.2.0, skip writing to ImageContentSourcePolicy
no digest mapping available for registry.redhat.io/amq7/amq-streams-operator:1.3.0, skip writing to ImageContentSourcePolicy
wrote mirroring manifests to manifests-ocp4-index-1612142634
[root@preserve-olm-env 4.6]# cat manifests-ocp4-index-1612142634/catalogSource.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: ocp4-index
  namespace: openshift-marketplace
spec:
  image: localhost:5000/test/openshift-qe-optional-operators-ocp4-index:latest
  sourceType: grpc
[root@preserve-olm-env 4.6]# cat manifests-ocp4-index-1612142634/imageContentSourcePolicy.yaml 
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  name: ocp4-index
spec:
  repositoryDigestMirrors:
  - mirrors:
    - localhost:5000/test/openshift4-ose-clusterresourceoverride-rhel8-operator
    source: registry.redhat.io/openshift4/ose-clusterresourceoverride-rhel8-operator
  - mirrors:
    - localhost:5000/test/openshift4-ose-logging-elasticsearch6
    source: registry.redhat.io/openshift4/ose-logging-elasticsearch6
...

Looks good, verify it.

Comment 5 errata-xmlrpc 2021-02-08 13:51:25 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 (Important: OpenShift Container Platform 4.6.16 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-2021:0308


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