Bug 1878823 - "oc adm release mirror" generating incomplete imageContentSources when using "--to" and "--to-release-image"
Summary: "oc adm release mirror" generating incomplete imageContentSources when using ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.0
Assignee: Sally
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-14 15:13 UTC by Robert Heinzmann
Modified: 2021-09-18 03:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:17:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 640 0 None closed Bug 1878823: 'oc adm release mirror' add --to-release mirrors to generated ICSP 2021-01-06 14:16:13 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:18:22 UTC

Description Robert Heinzmann 2020-09-14 15:13:16 UTC
Description of problem:

When running "oc adm release mirror" command with both flags "--to" and "--to-release-image" and both having a different repository URL (same registry, different org or image name), the printed "imageContentSources" example is missing the release image.

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

4.5.8

How reproducible:

Always

Steps to Reproduce:
1. Mirror with 

oc adm -a pull-secret.txt release mirror --from=quay.io/openshift-release-dev/ocp-release:4.5.8-x86_64 --to=quay-intern.example.com/ocp4/openshift-release-dev --to-release-image=quay-intern.example.com/ocp4/ocp-release:4.5.8-x86_64

2. Check generated imageContentSources

Actual results:

~~~
imageContentSources:
- mirrors:
  - quay-intern.example.com/ocp4/openshift-release-dev
  source: quay.io/openshift-release-dev/ocp-release
- mirrors:
  - quay-intern.example.com/ocp4/openshift-release-dev
  source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
~~~

Expected results:

~~~
imageContentSources:
- mirrors:
  - quay-intern.example.com/ocp4/ocp-release
  source: quay.io/openshift-release-dev/ocp-release
- mirrors:
  - quay-intern.example.com/ocp4/openshift-release-dev
  source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
~~~

Additional info:

It seems the printImageContentInstructions function is only considering the "--to" cli option and ignores the "--to-release-image" setting in https://github.com/openshift/oc/blob/a695d74ef1aee9a3f605d38dd8b6fae2062b63fc/pkg/cli/admin/release/mirror.go#L815

Comment 2 Sally 2020-10-01 21:37:11 UTC
This missed my attention last sprint, as we were focused on other bugs. I will be sure to pick it up in the upcoming sprint.

Comment 3 Sally 2020-10-23 17:21:26 UTC
Actively working on this, adding UpcomingSprint.

Comment 5 Sally 2020-11-12 18:57:30 UTC
Sorry for the delay, opened a PR w/ oc to resolve this, thanks.
Adding UpcomingSprint, to track review of the PR.

Comment 12 errata-xmlrpc 2021-02-24 15:17:46 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.0 security, bug fix, and enhancement 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-2020:5633


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