Description of problem: oc-mirror does not catch invalid registry input when a namespace is specified Version-Release number of selected component (if applicable): Client Version: version.Info{Major:"0", Minor:"2", GitVersion:"v0.2.0-alpha.1", GitCommit:"c732df4804f571b3d6a01aa24d58fed22c495129", GitTreeState:"clean", BuildDate:"2022-03-23T11:33:16Z", GoVersion:"go1.17.1", Compiler:"gc", Platform:"linux/amd64"} How reproducible: 100% Steps to Reproduce: 1. oc-mirror --config ~/configs/imageset-config.yaml docker://registry:5000/test error: error rebuilding catalog images from file-based catalogs: POST https://index.docker.io/v2/test/redhat/redhat-operator-index/blobs/uploads/: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:test/redhat/redhat-operator-index Type:repository] map[Action:push Class: Name:test/redhat/redhat-operator-index Type:repository]] Actual results: The error is caught very late in the processes and not during argument checking Expected results: A less ambiguous error Additional info: https://github.com/openshift/oc-mirror/issues/382
with older client: ./oc-mirror version Client Version: version.Info{Major:"0", Minor:"2", GitVersion:"v0.2.0-alpha.1", GitCommit:"c5d347f0edf0a70f4dfef65828ba6835d8993c65", GitTreeState:"clean", BuildDate:"2022-03-18T21:28:02Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"} ./oc-mirror --config deleteimage/settingconfig.yaml docker://registry:5000 error: destination registry must consist of registry host and namespace(s) only ./oc-mirror --config deleteimage/settingconfig.yaml docker://registry:5000/test INFO Checking push permissions for registry:5000 error: error checking push permissions for registry:5000: creating push check transport for registry:5000 failed: Get "https://registry:5000/v2/": Service Unavailable with latest oc-mirror : oc-mirror version Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202206070117.p0.gc7201c9.assembly.stream-c7201c9", GitCommit:"c7201c98a6c27773ba2414d4735ab97fd35d5c75", GitTreeState:"clean", BuildDate:"2022-06-07T01:51:03Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"} [root@localhost ocmirrortest]# oc-mirror --config deleteimage/settingconfig.yaml docker://registry:5000 The docker reference was parsed as image:tag, not as hostname:port. To specify a registry, use a qualified hostname. For example, instead of docker://registry:5000, use docker://registry.localdomain:5000 error: destination registry must consist of registry host and namespace(s) only, and must not include an image tag or ID oc-mirror --config deleteimage/settingconfig.yaml docker://registry:5000/test Checking push permissions for registry:5000 error: error checking push permissions for registry:5000: creating push check transport for registry:5000 failed: Get "https://registry:5000/v2/": Service Unavailable
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