Commit Graph

10 Commits (284e8182a402cfd545fc000fedaea071fed873b0)

Author SHA1 Message Date
juanvallejo ac6ca38dd7 report outputFormat in PrintFlags err 2018-04-25 16:35:56 -04:00
juanvallejo 27bd4ded04 wire printflags through additional cmds 2018-04-25 16:07:32 -04:00
WanLinghao e96794e689 when copy file from host to pod like this:
1.kubectl copy /tmp/test-file test-pod:/
	2.kubectl copy /tmp/test-file test-pod:
	example 1 will fail, example 2 will cause a panic.
	This patch fix bugs above.
2018-03-28 10:37:29 +08:00
Brendan Burns d196afabc4 Fix a bug where malformed paths don't get written to the destination dir. 2018-03-16 12:19:31 -07:00
Clayton Coleman d3790db03a
The cp command must call Close() on files, and does not pass on Mac
Path operations needed to be with filepath, not path (for cross
platform compat), and TMPDIR is not guaranteed to have a trailing slash.
2017-11-03 22:21:29 -04:00
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