Bug 1902299 - 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.7.0
Assignee: Kevin Rizza
QA Contact: Jian Zhang
URL:
Whiteboard:
: 1911226 (view as bug list)
Depends On:
Blocks: 1917549
TreeView+ depends on / blocked
 
Reported: 2020-11-27 16:18 UTC by Yurii Prokulevych
Modified: 2021-02-24 15:36 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:36:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 673 0 None closed Bug 1902299: catalog mirror improvements 2021-02-16 17:34:49 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:36:52 UTC

Description Yurii Prokulevych 2020-11-27 16:18:20 UTC
Description of problem:
-----------------------
Mirroring operator's catalog within disconnected environment failed:

oc --loglevel=1  adm catalog mirror \
  registry....com:5000/olm/redhat-operator-index:latest \
  registry....com:5000 \
  -a access-secret.json \
  --manifests-only=true \
  --icsp-scope=registry \
  --to-manifests=redhat-operator-index-manifests \
  --filter-by-os=linux/amd64

src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/199317583
error: destination registry required


Version-Release number of selected component (if applicable):
-------------------------------------------------------------
oc version
Client Version: 4.7.0-0.nightly-2020-11-26-112258
Server Version: 4.7.0-0.nightly-2020-11-26-221840
Kubernetes Version: v1.19.2+ad738ba


Steps to Reproduce:
-------------------
1. Prune all but specified images from the source image
2. Push the new index image to your target registry
3. Mirror content of newly created index image

Actual results:
---------------
`oc adm catalog mirror ...` failed

Expected results:
-----------------
`oc adm catalog mirror ...` succeeds

Additional info:
----------------
Virtual deployment 3masters + 2 workers

Comment 7 Jian Zhang 2020-12-29 02:44:27 UTC
*** Bug 1911226 has been marked as a duplicate of this bug. ***

Comment 13 Jian Zhang 2021-01-18 08:16:45 UTC
1, Install the `oc` that contains the fixed PR, as follows:
[root@preserve-olm-env data]# oc version
Client Version: 4.7.0-0.nightly-2021-01-17-211555
Server Version: 4.7.0-0.nightly-2021-01-18-000316
Kubernetes Version: v1.20.0+d9c52cc
[root@preserve-olm-env data]# oc version -o yaml
clientVersion:
  buildDate: "2021-01-16T22:37:00Z"
  compiler: gc
  gitCommit: 4d52be6017616fe8836a51b820777df2f71d179f
  gitTreeState: clean
  gitVersion: 4.7.0-202101162121.p0-4d52be6
  goVersion: go1.15.5
  major: ""
  minor: ""
  platform: linux/amd64
openshiftVersion: 4.7.0-0.nightly-2021-01-18-000316
releaseClientVersion: 4.7.0-0.nightly-2021-01-17-211555
serverVersion:
  buildDate: "2021-01-16T04:43:08Z"
  compiler: gc
  gitCommit: d9c52cc4e02894215b0d1c2aeea240fe77765c66
  gitTreeState: clean
  gitVersion: v1.20.0+d9c52cc
  goVersion: go1.15.5
  major: "1"
  minor: "20"
  platform: linux/amd64

2, Run `oc adm catalog mirror` command to mirror the images to the registry directly.

[root@preserve-olm-env data]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
0bb9ddaa46a3        registry            "/entrypoint.sh /etc…"   4 seconds ago       Up 3 seconds        0.0.0.0:5000->5000/tcp   registry
[root@preserve-olm-env data]#  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/270628314
wrote database to /tmp/270628314
using database at: /tmp/270628314/index.db
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/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 quay.io/openshift-qe-optional-operators/ocp4-index:latest, 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
wrote mirroring manifests to manifests-ocp4-index-1610956627
[root@preserve-olm-env data]# tree manifests-ocp4-index-1610956627/
manifests-ocp4-index-1610956627/
├── catalogSource.yaml
├── imageContentSourcePolicy.yaml
└── mapping.txt

0 directories, 3 files
[root@preserve-olm-env data]# cat manifests-ocp4-index-1610956627/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 data]# cat manifests-ocp4-index-1610956627/imageContentSourcePolicy.yaml 
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  name: ocp4-index
spec:
  repositoryDigestMirrors:
  - mirrors:
    - localhost:5000/openshift4/ose-cluster-nfd-operator
    source: registry.redhat.io/openshift4/ose-cluster-nfd-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 data]#  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/870248352
wrote database to /tmp/870248352
using database at: /tmp/870248352/index.db
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.redhat.io/amq7/amq-streams-operator:1.2.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 quay.io/openshift-qe-optional-operators/ocp4-index:latest, 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
wrote mirroring manifests to manifests-ocp4-index-1610956792
[root@preserve-olm-env data]# tree manifests-ocp4-index-1610956792
manifests-ocp4-index-1610956792
├── catalogSource.yaml
├── imageContentSourcePolicy.yaml
└── mapping.txt

0 directories, 3 files
[root@preserve-olm-env data]# cat manifests-ocp4-index-1610956792/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 data]# cat manifests-ocp4-index-1610956792/imageContentSourcePolicy.yaml 
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  name: ocp4-index
spec:
  repositoryDigestMirrors:
  - mirrors:
    - localhost:5000/test/openshift4-ose-sriov-cni
    source: registry.redhat.io/openshift4/ose-sriov-cni
...

Verify it.

Comment 16 errata-xmlrpc 2021-02-24 15:36:28 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.7.0 security, bug fix, and enhancement 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-2020:5633


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