Bug 1919032 - oc image extract - will not extract files from image rootdir - "error: unexpected directory from mapping tests.test"
Summary: oc image extract - will not extract files from image rootdir - "error: unexpe...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.7
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ---
: 4.8.0
Assignee: Robin Cernin
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-22 00:00 UTC by Motty Sisam
Modified: 2021-07-27 22:36 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
This patch fixes the issue where oc image extract would not extract files from the image root directory.
Clone Of:
Environment:
Last Closed: 2021-07-27 22:36:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 713 0 None closed Bug 1919032: Fix image extract from Root Directory 2021-02-19 01:59:00 UTC
Red Hat Product Errata RHSA-2021:2438 0 None None None 2021-07-27 22:36:56 UTC

Description Motty Sisam 2021-01-22 00:00:29 UTC
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:

Comment 3 Maciej Szulik 2021-02-08 12:23:11 UTC
Pushing this over to 4.8 since 4.7 is closed.

Comment 6 zhou ying 2021-02-10 01:29:50 UTC
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

Comment 9 errata-xmlrpc 2021-07-27 22:36:39 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 (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


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