Bug 1822253 - 'oc adm catalog mirror' generate a field.name in imagecontentsourcepolicy that can be invalid
Summary: 'oc adm catalog mirror' generate a field.name in imagecontentsourcepolicy tha...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.4
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.5.0
Assignee: Evan Cordell
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-08 15:08 UTC by Baptiste Mille-Mathias
Modified: 2020-07-13 17:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-13 17:26:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc issues 378 0 None open "oc adm catalog mirror" set an invalid value for field meta.name for imagecontentsourcepolicy manifest 2020-12-03 14:10:08 UTC
Github openshift oc issues 379 0 None open Bug 1822253: Remove invalid character from manifest meta.name field 2020-12-03 14:10:08 UTC
Github openshift oc pull 384 0 None closed oc adm catalog mirror updates: mac/windows, bundle image support, quay.io support 2020-12-03 14:10:09 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:26:47 UTC

Description Baptiste Mille-Mathias 2020-04-08 15:08:47 UTC
Description of problem:

When you create the mirror of the artifacts of the catalog, the content of the field meta.name of the manifest file is based on the path of the source registry, including / which are invalid.


Version-Release number of selected component (if applicable):
[bmillemathias@fedoravm olm-restricted]$ oc version
Client Version: 4.4.0-rc.6
Server Version: 4.3.1
Kubernetes Version: v1.16.2


How reproducible:
100%

Steps to Reproduce:
1. oc adm catalog mirror registry:5000/bmillemathias/olm/redhat-operators:v202004071506 registry:5000/bmillemathias/olm/redhat-operators-build

Actual results:
file imagecontentsourcepolicy.yaml
---
kind: ImageContentSourcePolicy
metadata:
  name: olm/redhat-operators # name is invalid because of / character
...       ^^^

Expected results:
file imagecontentsourcepolicy.yaml
---
kind: ImageContentSourcePolicy
metadata:
  name: olm-redhat-operators
...       

Additional info:

Comment 1 Evan Cordell 2020-04-15 00:44:22 UTC
This was fixed as a side effect of https://github.com/openshift/oc/pull/384

Comment 4 Jian Zhang 2020-04-15 14:02:41 UTC
1, Get the oc client that contains the fixed PR.
[jzhang@dhcp-140-36 ~]$ ./oc version -o yaml
clientVersion:
  buildDate: "2020-04-14T13:10:25Z"
  compiler: gc
  gitCommit: 53a16c59e5a7e4657f6eb098b46a3cc8d593fa7e
  gitTreeState: dirty
  gitVersion: openshift-clients-4.5.0-202004141216
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64
releaseClientVersion: 4.5.0-0.nightly-2020-04-15-072621
serverVersion:
  buildDate: "2019-05-02T11:52:09Z"
  compiler: gc
  gitCommit: d4cacc0
  gitTreeState: clean
  gitVersion: v1.11.0+d4cacc0
  goVersion: go1.10.8
  major: "1"
  minor: 11+
  platform: linux/amd64

2, Create a CatalogSource image.
[jzhang@dhcp-140-36 ~]$ ./oc adm catalog build --appregistry-org=redhat-operators-art --auth-token="xxx" --to localhost:5000/olm/jiazha/art:v4
...

3, Mirror it.
[jzhang@dhcp-140-36 ~]$ ./oc adm catalog mirror localhost:5000/olm/jiazha/art:v4 localhost:5000/olm/jiazha/art-bug
wrote database to /tmp/122082851/bundles.db
...

4, Check the ICSP object.
[jzhang@dhcp-140-36 ~]$ vim jiazha/art-manifests/imageContentSourcePolicy.yaml 

apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  name: jiazha-art
spec:
  repositoryDigestMirrors:
  - mirrors:
    - localhost:5000/olm/jiazha-art-bug-openshift-ose-sriov-dp-admission-controller
    source: image-registry.openshift-image-registry.svc:5000/openshift/ose-sriov-dp-admission-controller@sha256:f467b0179e8c37eacdaa76e92af406261c384dc967e47bbfd588e773243d276a

As we can see, the image name is "localhost:5000/olm/jiazha-art-bug-openshift-ose-sriov-dp-admission-controller", replace the "/" with "-".
LGTM, verify it.

Comment 5 errata-xmlrpc 2020-07-13 17:26:16 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.