Description of problem: When executing oc image extract on an image provided with --file="/file.ext" or --file="file" or --path=file.ext:./file.ext it will not extract it. we would get error: unexpected directory from mapping tests.test but when given a directory within such as --file="/dir/file.ext" then it would work. Version-Release number of selected component (if applicable): Client Version: 4.7.0-fc.3 How reproducible: 1. For seeing that's it is Not working: oc image extract image_name --path /somefile.txt:/tmp/ 2. for it to work oc image extract image_name --path /tmp/somefile.txt:/tmp/ Actual results: File is not copied from / getting error: error: unexpected directory from mapping file.txt Expected results: For file to be copied from / Additional info:
Pushing this over to 4.8 since 4.7 is closed.
Confirmed with latest 4.8 oc, the issue has fixed: [root@preserver-workloadrhel-1 ext]# /root/oc version -o yaml clientVersion: buildDate: "2021-02-09T20:21:40Z" compiler: gc gitCommit: 1d60e58c7db414dd584ce214fadbe57f24022496 gitTreeState: clean gitVersion: 4.8.0-202102091857.p0-1d60e58 goVersion: go1.15.5 major: "" minor: "" platform: linux/amd64 releaseClientVersion: 4.8.0-0.nightly-2021-02-09-221546 [root@preserver-workloadrhel-1 ext]# /root/oc image extract localhost:5000/alpine:new --file /hello --insecure [root@preserver-workloadrhel-1 ext]# ls hello
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 (Moderate: OpenShift Container Platform 4.8.2 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-2021:2438