Bug 1807810 - oc image mirror --from-dir does not override --dir
Summary: oc image mirror --from-dir does not override --dir
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.4.0
Assignee: Maciej Szulik
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On: 1807807
Blocks: 1807812
TreeView+ depends on / blocked
 
Reported: 2020-02-27 09:59 UTC by Paul Weil
Modified: 2020-05-04 11:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of: 1807807
: 1807812 (view as bug list)
Environment:
Last Closed: 2020-05-04 11:43:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 324 0 None closed Bug 1807810: [release-4.4] override FileDir with FromFileDir if set in Complete 2020-11-03 09:10:54 UTC
Red Hat Product Errata RHBA-2020:0581 0 None None None 2020-05-04 11:43:19 UTC

Description Paul Weil 2020-02-27 09:59:40 UTC
+++ This bug was initially created as a clone of Bug #1807807 +++

Description of problem: Complete gives error error: you must specify at least one source image to pull and the destination to push to as SRC=DST or SRC DST [DST2 DST3 ...] if only --from-dir is specified even though it is supposed to override --dir.



How reproducible: Always


Steps to Reproduce:
1. mirror a release to a directory using 'release mirror' command
2. attempt to mirror the directory back to a registry with 'image mirror' command specifying --from-dir (do not speicfy --dir)

./oc image mirror -a ${LOCAL_SECRET_JSON} --from-dir=/tmp/mirror-file file://openshift/release:4.3.3* ${LOCAL_REGISTRY}/ocp-4.3


Actual results:
error: you must specify at least one source image to pull and the destination to push to as SRC=DST or SRC DST [DST2 DST3 ...]


Expected results: directory mirrors to registry

Comment 4 XiuJuan Wang 2020-03-03 12:07:43 UTC
Could reproduce with old client.
Test with client 4.4.0-0.nightly-2020-03-03-033819, and passed

$oc version 
Client Version: 4.4.0-0.nightly-2020-03-03-033819
Server Version: 4.4.0-0.nightly-2020-03-02-042029
Kubernetes Version: v1.17.1

Cmd 
[1] $oc image mirror -a /tmp/kubeconfig/vsphere-mirror.json --from-dir=bz1807810 file://openshift/release:4.4.0-0.nightly-2020-03-03-033819* vsphere.mirror-registry.qe.devcluster.openshift.com:5000/xiuwang

[2] $oc image mirror -a /tmp/kubeconfig/vsphere-mirror.json --dir=bz1807810 file://openshift/release:4.4.0-0.nightly-2020-03-03-033819* vsphere.mirror-registry.qe.devcluster.openshift.com:5000/xiuwang1

[3] $oc image mirror -a /tmp/kubeconfig/vsphere-mirror.json --from-dir=bz1807810 file://openshift/release:4.4.0-0.nightly-2020-03-03-033819* vsphere.mirror-registry.qe.devcluster.openshift.com:5000/xiuwang1 --dir=notexist

[4] $oc image mirror -a /tmp/kubeconfig/vsphere-mirror.json --dir=bz1807810 file://openshift/release:4.4.0-0.nightly-2020-03-03-033819* vsphere.mirror-registry.qe.devcluster.openshift.com:5000/xiuwang1 --from-dir=notexist

Cmd [1] [2] [3] passed without error. Log here http://pastebin.test.redhat.com/841386
[4] failed as expected, "error: you must specify at least one source image to pull and the destination to push to as SRC=DST or SRC DST [DST2 DST3 ...]"

Comment 6 errata-xmlrpc 2020-05-04 11:43:01 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, 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/RHBA-2020:0581


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