Skip to content
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

Fix 'kubectl cp' with no arguments causes a panic #65482

Merged
merged 1 commit into from Jul 3, 2018

Conversation

@wgliang
Copy link
Member

wgliang commented Jun 26, 2018

What this PR does / why we need it:
/kind bug

"kubectl cp" with no arguments causes a panic

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #65475

Special notes for your reviewer:

Release note:

Fix 'kubectl cp' with no arguments causes a panic
@wgliang

This comment has been minimized.

Copy link
Member Author

wgliang commented Jun 26, 2018

/priority important-soon

@@ -164,6 +164,9 @@ func (o *CopyOptions) Validate(cmd *cobra.Command, args []string) error {
}

func (o *CopyOptions) Run(args []string) error {
if len(args) < 2 {
return fmt.Errorf("Unexpected args: %v", args)

This comment has been minimized.

@juanvallejo

juanvallejo Jun 26, 2018

Member

I think suggesting to the user what is required might make more sense:
a source and a destination are required or something along those lines

@wgliang wgliang force-pushed the wgliang:master.handle-args branch from 14d6e4d to 630bbf1 Jun 26, 2018

@wgliang

This comment has been minimized.

Copy link
Member Author

wgliang commented Jun 27, 2018

/test pull-kubernetes-e2e-gce

@CaoShuFeng

This comment has been minimized.

Copy link
Member

CaoShuFeng commented Jun 27, 2018

/lgtm

@wgliang

This comment has been minimized.

Copy link
Member Author

wgliang commented Jun 27, 2018

/assign @janetkuo
PTAL

@wgliang

This comment has been minimized.

Copy link
Member Author

wgliang commented Jun 27, 2018

NOTE:
Need to cherrypick to past versions.

@nikhita

This comment has been minimized.

Copy link
Member

nikhita commented Jun 27, 2018

/sig cli

@tuminoid

This comment has been minimized.

Copy link

tuminoid commented Jun 27, 2018

Does this also fix panic in #65475 (comment) ie. kubectl cp file container: ?

@tuminoid

This comment has been minimized.

Copy link

tuminoid commented Jun 27, 2018

Answering myself: no. The fix specifically handles case with no arguments at all.

@nikhita

This comment has been minimized.

Copy link
Member

nikhita commented Jul 1, 2018

@wgliang

This comment has been minimized.

Copy link
Member Author

wgliang commented Jul 2, 2018

@juanvallejo

This comment has been minimized.

Copy link
Member

juanvallejo commented Jul 2, 2018

/lgtm

@soltysh for approval

@@ -164,6 +164,9 @@ func (o *CopyOptions) Validate(cmd *cobra.Command, args []string) error {
}

func (o *CopyOptions) Run(args []string) error {
if len(args) < 2 {
return fmt.Errorf("Unexpected args: %v, a source and a destination are required", args)

This comment has been minimized.

@soltysh

soltysh Jul 2, 2018

Contributor

Just source and destination are required will be sufficient.

This comment has been minimized.

@wgliang

wgliang Jul 3, 2018

Author Member

Done,
for approve

@wgliang wgliang force-pushed the wgliang:master.handle-args branch from 630bbf1 to 254b02b Jul 3, 2018

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jul 3, 2018

@nikhita

This comment has been minimized.

Copy link
Member

nikhita commented Jul 3, 2018

/retest

@soltysh

soltysh approved these changes Jul 3, 2018

Copy link
Contributor

soltysh left a comment

/lgtm
/approve

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Jul 3, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CaoShuFeng, juanvallejo, soltysh, wgliang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wgliang

This comment has been minimized.

Copy link
Member Author

wgliang commented Jul 3, 2018

/test pull-kubernetes-e2e-kops-aws

@k8s-github-robot

This comment has been minimized.

Copy link
Contributor

k8s-github-robot commented Jul 3, 2018

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 0c698a4 into kubernetes:master Jul 3, 2018

16 of 17 checks passed

Submit Queue Required Github CI test is not green: pull-kubernetes-kubemark-e2e-gce-big
Details
cla/linuxfoundation wgliang authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details

k8s-github-robot pushed a commit that referenced this pull request Jul 7, 2018

Kubernetes Submit Queue
Merge pull request #65789 from wgliang/automated-cherry-pick-of-#6548…
…2-upstream-release-1.11

Automatic merge from submit-queue.

Automated cherry pick of #65482: fix 'kubectl cp' with no arguments causes a panic

Cherry pick of #65482 on release-1.11.

#65482: Fix 'kubectl cp' with no arguments causes a panic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.