Description of problem: Can`t copy local directory & files to correct directory & files in a remote pod through "oc cp". Version-Release number of selected component (if applicable): oc v3.6.140 kubernetes v1.6.1+5115d708d7 features: Basic-Auth GSSAPI Kerberos SPNEGO How reproducible: Always Steps to Reproduce: 1.oc login and create two projects $oc new-project newproj02 $oc new-project newproj01 2.create application(e.g.ruby) in newproj01 and prepare files & dirs 2.1 Prepare local dirs /tmp/foo_dir 2.2 Prepare local files /tmp/foo /tmp/bar /tmp/foo_2 /tmp/foo_dir/foo.local $cat >>/tmp/foo<<-EOF > Copy from local. > EOF $cat >>/tmp/foo_2<<-EOF > Copy from local. > EOF 2.3 Prepare pod files /tmp/foo_pod /tmp/bar /tmp/bar_2 and dirs /tmp/bar_dir in a remote pod 3.Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the current namespace $oc cp /tmp/foo_dir ruby-1-4fcv8:/tmp/bar_dir 4.Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container $oc cp /tmp/foo ruby-1-4fcv8:/tmp/bar -c ruby 5.Copy /tmp/foo_2 local file to /tmp/bar_2 in a remote pod in namespace <some-namespace> $oc project newproj02 $oc cp /tmp/foo_2 newproj01/ruby-1-4fcv8:/tmp/bar_2 6.Copy /tmp/foo_pod from a remote pod to /tmp/bar locally $oc cp newproj01/ruby-1-4fcv8:/tmp/foo_pod /tmp/bar Actual results: 3.foo.local file not in /tmp/bar_dir directory in pod,but foo_dir directory was copied to /tmp directory $oc rsh ruby-1-4fcv8 $cat /tmp/bar_dir/foo.local cat: /tmp/bar_dir/foo.local: No such file or directory $ls /tmp ... foo_dir ... 4. foo local file content wasn't copied to bar file in pod,but foo local file was copied to /tmp directory $oc rsh ruby-1-4fcv8 $ls /tmp ... foo ... 5.Same as step 4 6. Can copy successfully, but it shows msg " tar: Removing leading `/' from member names" Expected results: 3.$oc rsh ruby-1-4fcv8 $ls /tmp/bar_dir foo.local 4.$cat /tmp/bar Copy from local. 5. Same as step 4 6. The msg is better to be removed Additional info:
Origin PR: https://github.com/openshift/origin/pull/15929
> 6. The msg is better to be removed "Removing leading `/' from member names" is output as part of the `tar` pkg. I think it makes sense to leave this warning
Upstream PR: https://github.com/kubernetes/kubernetes/pull/51215
Marking as "UpcomingRelease" this is entirely an upstream patch [1]; changes will be brought in with the next rebase. Closing downstream pull [2]. 1. https://github.com/kubernetes/kubernetes/pull/51215 2. https://github.com/openshift/origin/pull/15929
Upstream PR [1] has merged. Bug will be fixed next rebase. Marking as UpcomingRelease
Fixed in 3.8.
Testing with latest v3.8 oc v3.8.26, the bug still exists. Testing with latest v3.9 oc v3.9.0-0.16.0, the bug is fixed. Results are followed Saw "Flags: aos-3.9.0+" was added and the errata advisory is for 3.9, thus it is inferred "Target Release" 3.8.0 is outdated and will being updated $ oc version oc v3.9.0-0.16.0 kubernetes v1.9.0-beta1 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://api.free-int.openshift.com:443 openshift v3.8.18 kubernetes v1.8.1+0d5291c $ oc cp /tmp/foo_dir $POD:/tmp/bar_dir # Will get same result when with or without '/' is given after '/tmp/bar_dir' $ oc rsh $POD sh-4.2$ ls /tmp/bar_dir foo.local $ oc cp /tmp/foo $POD:/tmp/bar -c ruby $ oc rsh $POD sh-4.2$ ls /tmp/bar bar > The msg is better to be removed As to this, the msg still exists. IMO it is acceptable
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-2018:0489