Bug 1917548 - [4.6] Cannot filter the platform/arch of the index image
Summary: [4.6] Cannot filter the platform/arch of the index image
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 4.6.z
Assignee: Evan Cordell
QA Contact: Jian Zhang
URL:
Whiteboard: non-multi-arch
Depends On: 1908565
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-18 17:34 UTC by OpenShift BugZilla Robot
Modified: 2021-02-08 13:51 UTC (History)
21 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-08 13:51:25 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 711 0 None closed Bug 1917548: 4.6 backports for oc adm catalog mirror 2021-02-19 05:18:39 UTC
Red Hat Product Errata RHSA-2021:0308 0 None None None 2021-02-08 13:51:43 UTC

Comment 2 Jian Zhang 2021-01-29 01:49:59 UTC
1, Check the oc version that contains the fixed PR.
[root@preserve-olm-env data]# ./oc version -o yaml
clientVersion:
  buildDate: "2021-01-28T20:12:01Z"
  compiler: gc
  gitCommit: e695bbc5b91ab04acb891c1c52dc5832de636b8a
  gitTreeState: clean
  gitVersion: openshift-clients-4.6.0-202006250705.p0-189-ge695bbc5b
  goVersion: go1.15.5
  major: ""
  minor: ""
  platform: linux/amd64
releaseClientVersion: 4.6.0-0.nightly-2021-01-28-210453
...

2, both --index-filter-by-os and --filter-by-os work well.
[root@preserve-olm-env data]# ./oc adm catalog mirror --index-filter-by-os='linux/amd64'  registry.redhat.io/redhat/redhat-operator-index:v4.6 localhost:5000 --manifests-only
src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/994800811
...
...
[root@preserve-olm-env data]# tree manifests-redhat-operator-index-1611883490
manifests-redhat-operator-index-1611883490
├── catalogSource.yaml
├── imageContentSourcePolicy.yaml
└── mapping.txt

0 directories, 3 files
[root@preserve-olm-env data]# cat manifests-redhat-operator-index-1611883490/catalogSource.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: redhat-operator-index
  namespace: openshift-marketplace
spec:
  image: localhost:5000/redhat/redhat-operator-index:v4.6
  sourceType: grpc


[root@preserve-olm-env data]# cat manifests-redhat-operator-index-1611883490/imageContentSourcePolicy.yaml
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  name: redhat-operator-index
spec:
  repositoryDigestMirrors:
  - mirrors:
    - localhost:5000/openshift-serverless-1-tech-preview/serving-queue-rhel8
    source: registry.redhat.io/openshift-serverless-1-tech-preview/serving-queue-rhel8
  - mirrors:
...

[root@preserve-olm-env data]# cat manifests-redhat-operator-index-1611883490/mapping.txt
registry.redhat.io/container-native-virtualization/virt-cdi-cloner@sha256:d5ebd9aa9b0b0d8c3e5c902ef14788f9b1815dd02f0330fbca218e22066c0c8e=localhost:5000/container-native-virtualization/virt-cdi-cloner:e6da36c2
registry.redhat.io/openshift-serverless-1/kn-cli-artifacts-rhel8@sha256:e1f7c006785abc7c82eb0f468770eefec6f9bd01f6859bffab92de52887775a4=localhost:5000/openshift-serverless-1/kn-cli-artifacts-rhel8:694dada4
...


[root@preserve-olm-env data]# ./oc adm catalog mirror --filter-by-os='linux/amd64'  registry.redhat.io/redhat/redhat-operator-index:v4.6 localhost:5000 --manifests-only
src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/093801290
...
[root@preserve-olm-env data]# tree manifests-redhat-operator-index-1611883964
manifests-redhat-operator-index-1611883964
├── catalogSource.yaml
├── imageContentSourcePolicy.yaml
└── mapping.txt

0 directories, 3 files
[root@preserve-olm-env data]# cat manifests-redhat-operator-index-1611883964/catalogSource.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: redhat-operator-index
  namespace: openshift-marketplace
spec:
  image: localhost:5000/redhat/redhat-operator-index:v4.6
  sourceType: grpc

3, the difference from 4.7:
the `--filter-by-os` still exist.
      --filter-by-os='': Use --index-filter-by-os instead. A regular expression to control which index image is picked
when multiple variants are available. Images will be passed as '<platform>/<architecture>[/<variant>]'. This does not
apply to images referenced by the index.

As Evan said in https://bugzilla.redhat.com/show_bug.cgi?id=1908565#c32, removing `--filter-by-os` will not be backported to 4.6.z

Looks good, verify it.

Comment 5 errata-xmlrpc 2021-02-08 13:51:25 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 (Important: OpenShift Container Platform 4.6.16 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:0308


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