Bug 2090751

Summary: oc image mirror skip-missing flag does not skip images
Product: OpenShift Container Platform Reporter: iwatson
Component: ocAssignee: Maciej Szulik <maszulik>
oc sub component: oc QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: mfojtik, rpeoples
Version: 4.11   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:14:33 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 iwatson 2022-05-26 13:28:32 UTC
Description of problem:

This issue has been raised upstream in https://github.com/openshift/oc/issues/1104

PR in https://github.com/openshift/oc/pull/1105

The SkipMissing flag in oc image mirror is incomplete. Currently this flag does not fulfil its purpose which has a knock on effect for oc-mirror. 


The knock on effect for oc-mirror is documented in https://bugzilla.redhat.com/show_bug.cgi?id=2089918

How reproducible: 100%

Steps to Reproduce:

Try use the skip-missing flag with oc image mirror to mirror a image that doesn't exist and see the return code is not 0. You can use any image that returns 404 aka anything random or even something like this which should be there but isn't.

registry.redhat.io/openshift-gitops-1/argocd-rhel8 sha256:ff4ad30752cf0d321cd6c2c6fd4490b716607ea2960558347440f2f370a586a8

Comment 4 zhou ying 2022-06-06 03:15:16 UTC
can't reproduce with latest version :

oc-mirror version 
Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202206030929.p0.gb22233e.assembly.stream-b22233e", GitCommit:"b22233e611ab4692748ffc992a235abd9c231ecf", GitTreeState:"clean", BuildDate:"2022-06-03T10:12:00Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}

[root@localhost operatorheadonly48]# oc-mirror  --config setting.yaml file://    --skip-missing
Found: oc-mirror-workspace/src/publish
Found: oc-mirror-workspace/src/v2
Found: oc-mirror-workspace/src/charts
backend is not configured in setting.yaml, using stateless mode
backend is not configured in setting.yaml, using stateless mode
No metadata detected, creating new workspace
WARN[0024] DEPRECATION NOTICE:
Sqlite-based catalogs and their related subcommands are deprecated. Support for
them will be removed in a future release. Please migrate your catalog workflows
to the new file-based catalog format. 
....

Comment 6 errata-xmlrpc 2022-08-10 11:14:33 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