Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2086962

Summary: oc-mirror publishes metadata with --dry-run when publishing to mirror
Product: OpenShift Container Platform Reporter: Jennifer Power <jpower>
Component: ocAssignee: Alex <aflom>
oc sub component: oc-mirror QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: jpower, vdinh
Version: 4.11   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2087271 (view as bug list) Environment:
Last Closed: 2022-08-10 11:12:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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