Bug 1942059 - `oc adm catalog mirror` doesn't work for the air-gapped cluster
Summary: `oc adm catalog mirror` doesn't work for the air-gapped cluster
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.z
Assignee: Evan Cordell
QA Contact: Bruno Andrade
URL:
Whiteboard:
Depends On: 1919168
Blocks: 1942818
TreeView+ depends on / blocked
 
Reported: 2021-03-23 14:49 UTC by OpenShift BugZilla Robot
Modified: 2021-04-05 13:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-05 13:56:42 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 779 0 None open [release-4.7] Bug 1942059: when mirroring to a file destination, mount images under the index location 2021-03-24 16:54:06 UTC
Red Hat Product Errata RHSA-2021:1005 0 None None None 2021-04-05 13:56:54 UTC

Comment 2 Bruno Andrade 2021-03-25 16:56:03 UTC
Use the `oc` client that fixed PR merged for testing.
./oc version -o yaml                                                                                          
clientVersion:
  buildDate: "2021-03-25T06:10:11Z"
  compiler: gc
  gitCommit: d0ceebe24ddf42b022198ef52eeb4e4181112600
  gitTreeState: clean
  gitVersion: 4.7.0-202103250517.p0-d0ceebe
  goVersion: go1.15.7
  major: ""
  minor: ""
  platform: linux/amd64
releaseClientVersion: 4.7.0-0.nightly-2021-03-25-081137

./oc adm catalog mirror quay.io/olmqe/redhat-operator-index:v4.6-2 file:///local/index                        
src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/360795679
wrote database to /tmp/360795679
using database at: /tmp/360795679/index.db
<dir>
  local/index/olmqe/redhat-operator-index
  info: Mirroring completed in 1m54.21s (14.32MB/s)
  wrote mirroring manifests to manifests-redhat-operator-index-1616688043

  To upload local images to a registry, run:

  	oc adm catalog mirror file://local/index/olmqe/redhat-operator-index:v4.6-2 REGISTRY/REPOSITORY

2. Check the images mirrored to the local
ls
manifests-redhat-operator-index-1616688043  v2

3. Switch to the parent folder, and tar this folder.
tar -cvf bug1942059.tar bug1942059 
bug1942059/
bug1942059/v2/
bug1942059/v2/local/
bug1942059/v2/local/index/
bug1942059/v2/local/index/olmqe/
bug1942059/v2/local/index/olmqe/redhat-operator-index/
bug1942059/v2/local/index/olmqe/redhat-operator-index/manifests/
bug1942059/v2/local/index/olmqe/redhat-operator-index/manifests/v4.6-2
bug1942059/v2/local/index/olmqe/redhat-operator-index/manifests/sha256:a94e22caf4d1a61c4ebd18d149d03bb4fef155fce457c77c153b501d5d2d7f86
...

4, Copy this tar package to another host. In real env, we should copy it to the Flash-Disk or Portable Hard Disk, and then copy it to the disconnected host.

5, Unzip this tar file.

6, `cd` this folder and mirror the image to the remote registry via `oc adm catalog mirror`
ls bug1942059                   
manifests-redhat-operator-index-1616688043  v2

././oc adm catalog mirror file://local/index/olmqe/redhat-operator-index:v4.6-2 quay.io/bandrade                                                                                                                                   130 ↵
src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/898736802
wrote database to /tmp/898736802
using database at: /tmp/898736802/index.db
quay.io/
  bandrade/local-index-olmqe-redhat-operator-index
...
info: Mirroring completed in 19m28.38s (1.39MB/s)

tree manifests-index/
manifests-index/
└── olmqe
    ├── redhat-operator-index-1616689077
    └── redhat-operator-index-1616689133
        ├── catalogSource.yaml
        ├── imageContentSourcePolicy.yaml
        └── mapping.txt

3 directories, 3 files

LGTM, marking as VERIFIED

Comment 5 errata-xmlrpc 2021-04-05 13:56:42 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.5 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:1005


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