Bug 2086962 - oc-mirror publishes metadata with --dry-run when publishing to mirror
Summary: oc-mirror publishes metadata with --dry-run when publishing to mirror
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.11.0
Assignee: Alex
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-16 22:36 UTC by Jennifer Power
Modified: 2022-08-10 11:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2087271 (view as bug list)
Environment:
Last Closed: 2022-08-10 11:12:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc-mirror pull 458 0 None open Bug 2086962: fix(publish): adds check for dry-run to ensure metadata is not proces… 2022-05-17 14:53:07 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:12:37 UTC

Description Jennifer Power 2022-05-16 22:36:13 UTC
Description of problem:

oc-mirror publishes metadata when running publishing operations with dry-run.


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

Client Version: version.Info{Major:"", Minor:"", GitVersion:"v0.2.0-alpha.1-37-g7c850e0", GitCommit:"7c850e01", GitTreeState:"dirty", BuildDate:"2022-05-16T19:46:17Z", GoVersion:"go1.17.1", Compiler:"gc", Platform:"linux/amd64"}


How reproducible:
100%


Steps to Reproduce:
1. Generate an imageset with oc-mirror. Can use any configuration.
2. Run a publish with dry run: 
oc-mirror --from mirror_seq1_000000.tar docker://localhost:5001 -v3 --dry-run
3. Run without dry-run
2. Run a publish with dry run: 
oc-mirror --from mirror_seq1_000000.tar docker://localhost:5001 -v3

Actual results:

Creates custom images and logs the following message:

Pushing metadata to registry at localhost:5001/oc-mirror:<uuid>

This result in an error on sequence when dry-run is removed
Checking metadata sequence number
error: error occurred during publishing, expecting imageset with prefix mirror_seq2: invalid mirror sequence order, want 2, got 1


Expected results:

oc-mirror should stop before pushing any images or publishing metadata


Additional info:
https://github.com/openshift/oc-mirror/issues/457

Comment 5 errata-xmlrpc 2022-08-10 11:12: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.11.0 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-2022:5069


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