Bug 1810256 - oc image mirror shouldn't default to mirroring manifest lists
Summary: oc image mirror shouldn't default to mirroring manifest lists
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.3.z
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.5.0
Assignee: Kevin Rizza
QA Contact: Bruno Andrade
URL:
Whiteboard:
Depends On:
Blocks: 1810268
TreeView+ depends on / blocked
 
Reported: 2020-03-04 19:51 UTC by Kevin Rizza
Modified: 2020-07-13 17:18 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1810268 (view as bug list)
Environment:
Last Closed: 2020-07-13 17:18:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 339 0 None closed Bug 1810256: Don't default to always mirror manifestlists 2021-02-04 21:28:43 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:18:34 UTC

Description Kevin Rizza 2020-03-04 19:51:32 UTC
Description of problem:

With this pr https://github.com/openshift/oc/pull/298 we introduced a change to enable `oc adm catalog mirror` to force mirror manifest list digests. However, we also introduced the behavior that oc image mirror also always enables that force option with no method of disabling it.

`oc image mirror` should retain the old default behavior (oc image mirror doesn't mirror the manifest list if there is only a single image in the list) with two exceptions:

1. There should be an explicit option to force the manifest list mirroring (like `--force-manifest-list`)
2. If --filter-by-os is passed a wildcard (`--filter-by-os=.*`) it should forcefully mirror the manifestlist.


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

4.5

How reproducible:

Always


Steps to Reproduce:
1. Run oc image mirror against a manifest list digest. Ex:

$ ./oc image mirror registry.redhat.io/openshift4/ose-sriov-network-webhook@sha256:d269ed4a4cbc5d8ecb2027891f2bd42ffaa61ce2785e38bd761ccbcd2d794c1d localhost:5000/kevinrizza/sriov:latest --dry-run


Actual results:

Manifest list was mirrored:

./oc image mirror registry.redhat.io/openshift4/ose-sriov-network-webhook@sha256:d269ed4a4cbc5d8ecb2027891f2bd42ffaa61ce2785e38bd761ccbcd2d794c1d localhost:5000/kevinrizza/sriov:latest --dry-run

localhost:5000/  
kevinrizza/sriov    
blobs:
      registry.redhat.io/openshift4/ose-sriov-network-webhook sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412 1.575KiB
      registry.redhat.io/openshift4/ose-sriov-network-webhook sha256:4377e81e5655f5852beea18997f4ff77d4f513b18d04587a275d30ea22874ae3 5.002KiB
      registry.redhat.io/openshift4/ose-sriov-network-webhook sha256:13be0effd90b69b59a7109cbb6133186be48c386dfb5a69e99965ad383451789 3.333MiB
      registry.redhat.io/openshift4/ose-sriov-network-webhook sha256:edf561fefe181b648d6502acfd17fd6a6bb8d378057dae272f36ffc850f65bf8 7.842MiB
      registry.redhat.io/openshift4/ose-sriov-network-webhook sha256:a27f668f2f9d1846948029fb27f6da2848e0764888c8f98b3f677035073a255d 8.893MiB
      registry.redhat.io/openshift4/ose-sriov-network-webhook sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b 72.71MiB
    manifests:
      sha256:2288935e7d2e4c1653ecb287c35a0dda11dddd10f034d85c025b95219a5f37ee
      sha256:d269ed4a4cbc5d8ecb2027891f2bd42ffaa61ce2785e38bd761ccbcd2d794c1d
      sha256:d269ed4a4cbc5d8ecb2027891f2bd42ffaa61ce2785e38bd761ccbcd2d794c1d -> latest
  stats: shared=0 unique=6 size=92.78MiB ratio=1.00

phase 0:
  localhost:5000 kevinrizza/sriov blobs=6 mounts=0 manifests=3 shared=0

info: Planning completed in 1.75s
info: Dry run complete

Expected results:

Just the underlying container image digest was mirrored

Comment 3 Bruno Andrade 2020-03-09 02:15:54 UTC
Image mirror worked as expected. Marking as VERIFIED

oc version
Client Version: 4.4.0-0.nightly-2020-03-06-141620

Steps used to reproduce.

1) Started a local registry as oriented on https://bugzilla.redhat.com/show_bug.cgi?id=1773821#c7 
2) cat imagelist.yml 
registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator@sha256:47623e1873c86d9c1bdd41cfb06ae7f7f175a1f74364c441c4d6dd765369059d=localhost:5000/test:v4.4.0
3) oc image mirror --filename=imagelist.yml  --insecure=true --skip-missing=true --skip-verification=true
localhost:5000/
  test
    blobs:
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412 1.575KiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:0146a450aa03211b02a411edc2123bdf156bc17808d2f554111c7b068a36c63e 5.351KiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:935ce2f796a92f0b6fa7762d7bab7d252ddb59d03cd3afba42d3785b571854f1 3.333MiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:b6555363e7f53679e058c70fcda710f30ba4f6e457645c1025c154b539ecd038 7.847MiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:b6f8660c86d2591f34712e27797fdd5e51b7ebd410610d16160a06da81791d56 22.04MiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b 72.71MiB
    manifests:
      sha256:917f7f7a0ba92a6ed1293ea54a7486fee71fa53e1cd25b23586c457ad402709d -> v4.4.0
  stats: shared=0 unique=6 size=105.9MiB ratio=1.00

phase 0:
  localhost:5000 test blobs=6 mounts=0 manifests=1 shared=0

info: Planning completed in 2.04s
uploading: localhost:5000/test sha256:935ce2f796a92f0b6fa7762d7bab7d252ddb59d03cd3afba42d3785b571854f1 3.333MiB
uploading: localhost:5000/test sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b 72.71MiB
uploading: localhost:5000/test sha256:b6555363e7f53679e058c70fcda710f30ba4f6e457645c1025c154b539ecd038 7.847MiB
uploading: localhost:5000/test sha256:b6f8660c86d2591f34712e27797fdd5e51b7ebd410610d16160a06da81791d56 22.04MiB
sha256:917f7f7a0ba92a6ed1293ea54a7486fee71fa53e1cd25b23586c457ad402709d localhost:5000/test:v4.4.0
info: Mirroring completed in 1m28.87s (1.25MB/s)

Comment 4 Bruno Andrade 2020-03-09 03:43:23 UTC
That one should be for 4.5, so doing again the tests with 4.5.0-0.nightly-2020-03-06-190457.
oc version
Client Version: 4.5.0-0.nightly-2020-03-06-190457
Server Version: 4.5.0-0.nightly-2020-03-06-190457
Kubernetes Version: v1.17.1


oc image mirror --filename=imagelist.yml  --insecure=true --skip-missing=true --skip-verification=true
localhost:5000/
  test
    blobs:
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412 1.575KiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:0146a450aa03211b02a411edc2123bdf156bc17808d2f554111c7b068a36c63e 5.351KiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:935ce2f796a92f0b6fa7762d7bab7d252ddb59d03cd3afba42d3785b571854f1 3.333MiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:b6555363e7f53679e058c70fcda710f30ba4f6e457645c1025c154b539ecd038 7.847MiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:b6f8660c86d2591f34712e27797fdd5e51b7ebd410610d16160a06da81791d56 22.04MiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b 72.71MiB
    manifests:
      sha256:917f7f7a0ba92a6ed1293ea54a7486fee71fa53e1cd25b23586c457ad402709d -> v4.4.0
  stats: shared=0 unique=6 size=105.9MiB ratio=1.00

phase 0:
  localhost:5000 test blobs=6 mounts=0 manifests=1 shared=0

info: Planning completed in 2.26s
uploading: localhost:5000/test sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b 72.71MiB
uploading: localhost:5000/test sha256:935ce2f796a92f0b6fa7762d7bab7d252ddb59d03cd3afba42d3785b571854f1 3.333MiB
uploading: localhost:5000/test sha256:b6555363e7f53679e058c70fcda710f30ba4f6e457645c1025c154b539ecd038 7.847MiB
uploading: localhost:5000/test sha256:b6f8660c86d2591f34712e27797fdd5e51b7ebd410610d16160a06da81791d56 22.04MiB
^C
[root@bastion-centos7 operator-lifecycle-manager]# oc image mirror --filename=imagelist.yml  --insecure=true --skip-missing=true --skip-verification=true
localhost:5000/
  test
    blobs:
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412 1.575KiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:0146a450aa03211b02a411edc2123bdf156bc17808d2f554111c7b068a36c63e 5.351KiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:935ce2f796a92f0b6fa7762d7bab7d252ddb59d03cd3afba42d3785b571854f1 3.333MiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:b6555363e7f53679e058c70fcda710f30ba4f6e457645c1025c154b539ecd038 7.847MiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:b6f8660c86d2591f34712e27797fdd5e51b7ebd410610d16160a06da81791d56 22.04MiB
      registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cluster-logging-operator sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b 72.71MiB
    manifests:
      sha256:917f7f7a0ba92a6ed1293ea54a7486fee71fa53e1cd25b23586c457ad402709d -> v4.4.0
  stats: shared=0 unique=6 size=105.9MiB ratio=1.00

phase 0:
  localhost:5000 test blobs=6 mounts=0 manifests=1 shared=0

info: Planning completed in 2.03s
uploading: localhost:5000/test sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b 72.71MiB
sha256:917f7f7a0ba92a6ed1293ea54a7486fee71fa53e1cd25b23586c457ad402709d localhost:5000/test:v4.4.0
info: Mirroring completed in 1m58.09s (645.6kB/s)

Comment 6 errata-xmlrpc 2020-07-13 17:18:09 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, 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


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