-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add kubectl cp #34914
add kubectl cp #34914
Conversation
ac1d951
to
5266230
Compare
@fabianofranz @csrwng fyi |
@k8s-bot verify test this |
@kubernetes/kubectl |
Review status: 0 of 3 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. pkg/kubectl/cmd/cp.go, line 2 at r1 (raw file):
super nit: 2016 pkg/kubectl/cmd/cp.go, line 37 at r1 (raw file):
Is namespace optional? pkg/kubectl/cmd/cp.go, line 40 at r1 (raw file):
Does this work on directories or just files? pkg/kubectl/cmd/cp.go, line 53 at r1 (raw file):
Should this be pkg/kubectl/cmd/cp.go, line 126 at r1 (raw file):
Does this compress the tar? Should it? pkg/kubectl/cmd/cp.go, line 139 at r1 (raw file):
How does this approach to compare to using the filepath walk function as described in this stalk overflow question? pkg/kubectl/cmd/cp_test.go, line 22 at r1 (raw file):
Please add tests for tar / untar. Is it possible to test copy to/from pod here as well? pkg/kubectl/cmd/cp_test.go, line 23 at r1 (raw file):
Would you also add an e2e test under https://github.com/kubernetes/kubernetes/blob/master/hack/make-rules/test-cmd.sh Comments from Reviewable |
FYI this keeps failing. Seems unrelated:
|
@brendandburns Thanks for work on this :) I look forward to using it. |
Review status: 0 of 3 files reviewed at latest revision, 8 unresolved discussions. pkg/kubectl/cmd/cp.go, line 2 at r1 (raw file):
|
@pwittrock comments addressed, please take another look. |
Reviewed 1 of 3 files at r1, 2 of 2 files at r2. pkg/kubectl/cmd/cp.go, line 126 at r1 (raw file):
|
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. pkg/kubectl/cmd/cp.go, line 126 at r1 (raw file):
|
@pwittrock replied to comments, ptal. thanks! |
Jenkins unit/integration failed for commit 42dfbe1. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GKE smoke e2e failed for commit 42dfbe1. Full PR test history. The magic incantation to run this job again is |
Reviewed 1 of 1 files at r3. pkg/kubectl/cmd/cp_test.go, line 22 at r1 (raw file):
|
FYI at least some of the test failures appear to be legit:
|
I am actually doing something where this would be really convienient :P |
Looks like you gave edit permissions and I can fix that minor error for you if you are ok with me doing so. |
42dfbe1
to
a198a57
Compare
self-LGTM on LGTM from @pwittrock |
Jenkins verification failed for commit a198a57. Full PR test history. The magic incantation to run this job again is |
}() | ||
|
||
// TODO: Improve error messages by first testing if 'tar' is present in the container? | ||
cmdArr := []string{"tar", "xf", "-"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tar
requirement on the pod should be explicitly specified in the description. Otherwise we'll get users complaining about it, imho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Ideas? |
a198a57
to
d65757f
Compare
self-lgtm after fixing the bazel issue. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
A nifty feature to kubectl cp would be that it would behave like "mkdir -p" when a parameter is added.
Currently kubectl cp does not seem to support this. |
Implements
kubectl cp
(#13776)Syntax examples:
@deads2k @smarterclayton @kubernetes/sig-cli
This change is