Bug 1919168
Summary: | `oc adm catalog mirror` doesn't work for the air-gapped cluster | |||
---|---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Jian Zhang <jiazha> | |
Component: | OLM | Assignee: | Evan Cordell <ecordell> | |
OLM sub component: | OLM | QA Contact: | Jian Zhang <jiazha> | |
Status: | CLOSED ERRATA | Docs Contact: | ||
Severity: | medium | |||
Priority: | medium | CC: | akaris, ansulliv, cshepher, dsover, ecordell, krizza | |
Version: | 4.7 | Keywords: | Triaged | |
Target Milestone: | --- | |||
Target Release: | 4.8.0 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Enhancement | ||
Doc Text: |
Feature: Air-gapped mirroring of operator catalogs
Reason: Prior to this, the `oc adm catalog mirror` command could not be easily used to mirror across an airgap.
Result: The contents of a catalog can be mirrored to a file system, placed onto removable media, and then mirrored back from the file system into a real registry for consumption by an airgapped cluster.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1990442 (view as bug list) | Environment: | ||
Last Closed: | 2021-07-27 22:36:39 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: | 1942059, 1990442 |
Description
Jian Zhang
2021-01-22 10:07:00 UTC
[jzhang@dhcp-140-36 4.6.8]$ oc adm catalog mirror --dir=v2/ file://local/index/olmqe/redhat-operator-index:v4.6-2 quay.io/jiazha error: unable to read image file://local/index/olmqe/redhat-operator-index:v4.6-2: unknown blob [jzhang@dhcp-140-36 4.6.8]$ oc image mirror --dir=v2/ file://local/index/olmqe/redhat-operator-index:v4.6-2 quay.io/jiazha error: unable to retrieve source image file://local/index/olmqe/redhat-operator-index by tag v4.6-2: unknown blob error: an error occurred during planning Use the `oc` client that fixed PR merged for testing. [root@preserve-olm-env client]# oc version -o yaml clientVersion: buildDate: "2021-03-23T20:25:48Z" compiler: gc gitCommit: 314b90b414e3048a243d828435ffc48e1549d862 gitTreeState: clean gitVersion: 4.8.0-202103231739.p0-314b90b goVersion: go1.15.7 major: "" minor: "" platform: linux/amd64 openshiftVersion: 4.8.0-0.nightly-2021-03-22-104536 releaseClientVersion: 4.8.0-0.nightly-2021-03-23-225416 serverVersion: buildDate: "2021-03-19T19:56:04Z" compiler: gc gitCommit: 39c0afe26e6c66d57a6ee53b925c16a6c4d272c7 gitTreeState: clean gitVersion: v1.20.0+39c0afe goVersion: go1.15.7 major: "1" minor: "20" platform: linux/amd64 1. Mirror an index images to local. [root@preserve-olm-env bug1919168]# 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/095063026 wrote database to /tmp/095063026 using database at: /tmp/095063026/index.db <dir> local/index/olmqe/redhat-operator-index ... info: Mirroring completed in 40.21s (40.68MB/s) wrote mirroring manifests to manifests-redhat-operator-index-1616556527 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 [root@preserve-olm-env bug1919168]# ls manifests-redhat-operator-index-1616556527 v2 3. Switch to the parent folder, and tar this folder. [root@preserve-olm-env bug1919168]# cd .. [root@preserve-olm-env airgapped]# ls 4.6.8 4.6.8.tar bug1919168 [root@preserve-olm-env airgapped]# tar -zcvf bug1919168.tar bug1919168 bug1919168/ bug1919168/manifests-redhat-operator-index-1616556527/ bug1919168/manifests-redhat-operator-index-1616556527/mapping.txt bug1919168/v2/ ... bug1919168/v2/local/index/olmqe/redhat-operator-index/manifests/v4.6-2 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. [root@preserve-olm-env airgapped]# ls 4.6.8.tar bug1919168.tar [root@preserve-olm-env airgapped]# tar -xvf bug1919168.tar ... bug1919168/v2/local/index/olmqe/redhat-operator-index/manifests/v4.6-2 [root@preserve-olm-env airgapped]# ls 4.6.8.tar bug1919168 bug1919168.tar 6, `cd` this folder and mirror the image to the remote registry via `oc adm catalog mirror` [root@preserve-olm-env airgapped]# cd bug1919168/ [root@preserve-olm-env bug1919168]# ls manifests-redhat-operator-index-1616556527 v2 [root@preserve-olm-env 4.6.8]# oc adm catalog mirror file://local/index/olmqe/redhat-operator-index:v4.6-2 quay.io/jiazha ... sha256:c1105fb39c658762597c1537ee9c1176a63c887dbdb7dc0709fe39ca9d0a4599 quay.io/jiazha/openshift4-ose-logging-curator5:7d0bc7a4 info: Mirroring completed in 1m38s (16.69MB/s) no digest mapping available for file://local/index/olmqe/redhat-operator-index:v4.6-2, skip writing to ImageContentSourcePolicy wrote mirroring manifests to manifests-index/olmqe/redhat-operator-index-1616557104 [root@preserve-olm-env bug1919168]# ls manifests-index manifests-redhat-operator-index-1616556527 v2 [root@preserve-olm-env bug1919168]# tree manifests-index/ manifests-index/ └── olmqe └── redhat-operator-index-1616557104 ├── catalogSource.yaml ├── imageContentSourcePolicy.yaml └── mapping.txt 2 directories, 3 files LGTM, verify it. *** Bug 1926457 has been marked as a duplicate of this bug. *** 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.8.2 bug fix and security 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:2438 |