• WanLinghao's avatar
    This patch improve kubectl cp command from two aspects · b1f85e2d
    WanLinghao authored
    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
    b1f85e2d
Name
Last commit
Last update
.github Loading commit data...
Godeps Loading commit data...
api Loading commit data...
build Loading commit data...
cluster Loading commit data...
cmd Loading commit data...
docs Loading commit data...
examples Loading commit data...
federation Loading commit data...
hack Loading commit data...
logo Loading commit data...
pkg Loading commit data...
plugin Loading commit data...
staging Loading commit data...
test Loading commit data...
third_party Loading commit data...
translations Loading commit data...
vendor Loading commit data...
.bazelrc Loading commit data...
.generated_files Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.kazelcfg.json Loading commit data...
BUILD.bazel Loading commit data...
CHANGELOG-1.2.md Loading commit data...
CHANGELOG-1.3.md Loading commit data...
CHANGELOG-1.4.md Loading commit data...
CHANGELOG-1.5.md Loading commit data...
CHANGELOG-1.6.md Loading commit data...
CHANGELOG-1.7.md Loading commit data...
CHANGELOG-1.8.md Loading commit data...
CHANGELOG-1.9.md Loading commit data...
CHANGELOG.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
Makefile.generated_files Loading commit data...
OWNERS Loading commit data...
OWNERS_ALIASES Loading commit data...
README.md Loading commit data...
SUPPORT.md Loading commit data...
Vagrantfile Loading commit data...
WORKSPACE Loading commit data...
code-of-conduct.md Loading commit data...
labels.yaml Loading commit data...