Bug 1812753

Summary: couldn't mirror image in mapping.txt created by oc adm catalog mirror
Product: OpenShift Container Platform Reporter: Anping Li <anli>
Component: OLMAssignee: Evan Cordell <ecordell>
OLM sub component: OLM QA Contact: Anping Li <anli>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, ashoshan, dsover, jiazha, jokerman, mfojtik, mr.anson.wang, oarribas, 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:
: 1826432 (view as bug list) Environment:
Last Closed: 2020-08-04 18:04:50 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:
Bug Depends On:    
Bug Blocks: 1826432, 1826434    
Attachments:
Description Flags
The mapping.txt generated by 'oc adm catalog mirror' none

Description Anping Li 2020-03-12 04:20:45 UTC
Description of problem:
The mapping.txt generated by 'oc adm catalog mirror' include destination without tags.  when mirror images using this mapping.txt. the command report erorr 'each destination tag may only be specified once: quay.io/openshift-qe-optional-operators/ose-cluster-logging-operator'.


Version-Release number of selected component (if applicable):
Client Version: 4.5.0-202003062301-8ce6126

How reproducible:
Always

Steps to Reproduce:
1.  build catalog image
oc adm catalog build   --appregistry-org=redhat-operators-stage --to=${QE_REGISTRY_PREFIX}qe-operators-registry:latest --insecure=true   --auth-token="basic $SOURCE_APPREGISTRY_ORG_TOKEN" -a $DOCKER_CONFIG_FILE

2. export manifest and generate mapping.txt
 adm catalog mirror  --manifests-only ${QE_REGISTRY_PREFIX}qe-operators-registry:latest --insecure=true  quay.io -a $DOCKER_CONFIG_FILE

3. mirror images to qa-registry
oc image mirror --insecure=true -f qe-operators-registry-manifests/mapping.txt -a $DOCKER_CONFIG_FILE

Actual results:

oc image mirror --insecure=true -f mapping.txt -a mirror_docker.conf
error: file mapping.txt, line 2: each destination tag may only be specified once: quay.io/openshift-qe-optional-operators/ose-cluster-logging-operator

cat mapping.txt
registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator@sha256:de5d07920763f189af191c301f690b3ac945acaafed3fbc314e0e417c91db211=quay.io/openshift-qe-optional-operators/ose-cluster-logging-operator
registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator@sha256:28e12c981441dd416fbd549ae64a3c8cf5147bd468d5b790a266e5ca8ef2d027=quay.io/openshift-qe-optional-operators/ose-cluster-logging-operator
registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator@sha256:e7b9096dc5c88de2aad6754fac20814f6a2faca5904f928501b1dbce0d3883b4=quay.io/openshift-qe-optional-operators/ose-cluster-logging-operator
registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator@sha256:c3b459eda6735800bc46cd5037aa6946c1c0c9f3414c9f208ae2c54f197483f5=quay.io/openshift-qe-optional-operators/ose-cluster-logging-operator

Expected results:
Option A:
The mapping file created by 'oc adm catalog mirror' can be used directly.
1) it should set a unique tag to the destination image

Optiona B:
The 'oc image mirror' support duplicated destination tag.  As the manifest are forced to be uploaded now.  I do not think the destination tag must be mandatory.

Comment 1 Anping Li 2020-03-12 04:34:21 UTC
Created attachment 1669523 [details]
The mapping.txt generated by 'oc adm catalog mirror'

Note: The description is using a different mapping.txt.

Comment 7 Anping Li 2020-05-19 05:57:05 UTC
Each images in mapping.txt have a unique tag. so move to verified.

Comment 10 errata-xmlrpc 2020-08-04 18:04:50 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 (OpenShift Container Platform 4.5 image release 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