Commit Graph

5 Commits (f34a24e98e7c837b567b78be3af958ac1156cd80)

Author SHA1 Message Date
WanLinghao b1f85e2dfe This patch improve kubectl cp command from two aspects
A.support soft link better
before this patch
  "kubectl cp" command will copy the soft link to destination as an empty regular file
after this patch
  "kubectl cp" command will behave the same as tar command
  this patch improves it on both from container and to container

B.fix some bugs
1.from container to host
  a.when copy a file ends with '/', it will cause a panic.
    for example, container gakki has a regular file /tmp/test, then run command
    kubectl cp gakki:/tmp/test/ /tmp
    panic happens
  b.when copy a file which does not exist in container, the command ends up without
    any error information

2.from host to container
  a.when run command like
    kubectl cp "" gakki:/tmp
    it will try cp current directory to container, in other words, this command works
    the same as kubectl cp . gakki:/tmp
  b.current cp command will omit an empty directory

modified:   pkg/kubectl/cmd/cp.go
modified:   pkg/kubectl/cmd/cp_test.go
2017-10-13 13:51:53 +08:00
juanvallejo 2371accf0c
preserve specified destination path 2017-10-10 18:16:10 -04:00
bruceauyeung 19b572448a kubectl cp support coping remote file into local dir
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-09-28 10:06:07 +08:00
WanLinghao c00f9bc140 fix kubectl cp command error.
it happens when copy directory to pod and the directory
path ends with '/'.
for example:
kubectl cp /XX/XX/ XX-POD:/XX/XX

modified:  pkg/kubectl/cmd/cp.go
modified:  pkg/kubectl/cmd/cp_test.go
2017-09-11 17:22:13 +08:00
Brendan Burns d65757fb88 add kubectl cp 2016-10-29 20:24:54 -07:00