Bug 1926457 - oc adm catalog mirror errors when using a file output destination
Summary: oc adm catalog mirror errors when using a file output destination
Keywords:
Status: NEW
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Evan Cordell
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-08 20:02 UTC by Andrew Sullivan
Modified: 2021-02-11 14:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Andrew Sullivan 2021-02-08 20:02:34 UTC
Description of problem:
Attempting to mirror a catalog index, whether pruned or not, to disk for migrating to a disconnected network results in errors preventing the images from being mirrored and an empty imageContentSourcePolicy.

Version-Release number of selected component (if applicable):
Tested with oc version 4.6.12 and 4.5.31

How reproducible:
Every time.

Steps to Reproduce:
1. Optionally, create a pruned index image:

opm index prune \
 -f registry.redhat.io/redhat/redhat-operator-index:v4.6 \
 -p kubevirt-hyperconverged \
 -t registry.domain.name:5000/cnv-operator-index:v4.6

2. Mirror the catalog to disk:

oc adm catalog mirror \
 registry.domain.name:5000/cnv-operator-index:v4.6 \
 file:///redhat \
 --filter-by-os='.*'

Actual results:

All images in the index return the following errors:

[ansulliv@bastion mirror]$ oc adm catalog mirror registry.domain.name:5000/cnv-operator-index:v4.6 file:///redhat --filter-by-os='.*'
src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/796358406
wrote database to /tmp/796358406
using database at: /tmp/796358406/index.db
error parsing target reference for {/file:/redhat-container-native-virtualization-hyperconverged-cluster-operator@sha256:c47d457c5e3c0d34cc4659243c64d9e1a6589b9459e087ba5a4822578aea93b0 /file:/redhat-container-native-virtualization-hyperconverged-cluster-operator:75796bf0}, skip writing to ImageContentSourcePolicy
error parsing target reference for {/file:/redhat-container-native-virtualization-virt-cdi-controller@sha256:afe11653815be24b3fb12191cd556d3291ff639059a0fb800585889acbb603c8 /file:/redhat-container-native-virtualization-virt-cdi-controller:82d97157}, skip writing to ImageContentSourcePolicy

Expected results:
Images successfully mirrored to disk.

Additional info:
Verified that mirroring a pruned index from a public registry directly to a local registry does work as expected with oc 4.6.12, e.g.:

oc adm catalog mirror registry.domain.name:5000/cnv-operator-index:v4.6 registry.domain.name:5000 --filter-by-os='.*'


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