Bug 1903230 - oc adm catalog mirror does not mirror the catalog image
Summary: oc adm catalog mirror does not mirror the catalog image
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: 4.7.0
Assignee: Evan Cordell
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-01 16:48 UTC by nathan.brophy
Modified: 2021-01-06 18:34 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-06 18:34:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description nathan.brophy 2020-12-01 16:48:55 UTC
Description of problem:

oc adm catalog mirror command does not add the source catalog image to the mapping.txt file to mirror to the target location. 

There seem to be related bugs to this opened in bugzilla, but opening again because seeing this on a different version of the oc CLI.

Version-Release number of selected component (if applicable):

$ oc version --client
Client Version: 4.6.6

How reproducible: Always


Steps to Reproduce:
1. Select a source catalog index image
2. Run oc adm catalog mirror <source> <target registry> --manifests-only=true [--filter-by-os]
3. Examine the mapping.txt file produced in the output location, and the <source> catalog index image is not included in the mapping.txt to mirror to the target location.  

Actual results:

Catalog index image used as source is NOT mirrored to target registry.


Expected results:

Catalog index image used as source is successfully mirrored to target registry.

Additional info:

Seeing this on OCP versions 4.5.X and 4.6.0 nightly release build and most recent 4.6.6 build of oc

Comment 1 Robert Bohne 2020-12-02 12:00:04 UTC
From my point of view, this is duplicated to 1890951.

Work-a-round is to add `--filter-by-os='.*'` to oc adm catalog mirror.

Comment 2 Maciej Szulik 2020-12-03 10:30:38 UTC
Agree with Robert here, this is duplicate.

*** This bug has been marked as a duplicate of bug 1890951 ***

Comment 4 Robert Bohne 2020-12-15 07:09:25 UTC
Oh right, my bad.


During the Pruning an index image [1] step the catalog index is pulled from redhat registry and pushed into local registry. Might be useful to add a part into the documentation: how to mirror the full index image with without pruning. Something like
```
oc image mirror registry.redhat.io/redhat/redhat-operator-index:v4.6 <target_registry>:<port>/<namespace>/redhat-operator-index:v4.6 
```

[1] https://docs.openshift.com/container-platform/4.6/operators/admin/olm-restricted-networks.html#olm-pruning-index-image_olm-restricted-networks


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