Bug 2090819
| Summary: | oc-mirror does not catch invalid registry input when a namespace is specified | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Jennifer Power <jpower> |
| Component: | oc | Assignee: | 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: | Environment: | ||
| Last Closed: | 2022-08-10 11:14:36 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: | |||
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 |
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