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

Support completion for kubectl cp #60371

Merged
merged 1 commit into from May 8, 2018

Conversation

Projects
None yet
7 participants
@superbrothers
Member

superbrothers commented Feb 24, 2018

What this PR does / why we need it: With this PR, kubectl cp supports completion. I tested this PR in bash and zsh.

$ kubectl cp kube-system/<tab>
kube-system/kube-state-metrics-769566fdfb-4v52s:   kube-system/kubernetes-dashboard-6b6ddbd46-t5bv9:  kube-system/prometheus-694594c45b-qk5lq:

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 kubernetes/kubectl#5

Special notes for your reviewer: @cblecker

Release note:

`kubectl cp` supports completion.
Support completion for kubectl cp
With this commit, kubectl cp supports completion.

```
$ kubectl cp kube-system/                                                                                                                                                                                    ()
kube-system/kube-state-metrics-769566fdfb-4v52s:   kube-system/kubernetes-dashboard-6b6ddbd46-t5bv9:  kube-system/prometheus-694594c45b-qk5lq:
```
@cblecker

This comment has been minimized.

Member

cblecker commented Feb 24, 2018

/ok-to-test

@cblecker cblecker self-assigned this Feb 24, 2018

@cblecker

This comment has been minimized.

Member

cblecker commented Apr 3, 2018

This looks fine to me.
/lgtm
/assign @deads2k
/test pull-kubernetes-typecheck

@deads2k

This comment has been minimized.

Contributor

deads2k commented Apr 4, 2018

@eparis this sort of thing smells like you. You done completions before? I don't really know what it does.

@soltysh

This comment has been minimized.

Contributor

soltysh commented Apr 10, 2018

/assign @juanvallejo

@juanvallejo

This comment has been minimized.

Member

juanvallejo commented Apr 10, 2018

lgtm. From what I understand, you'll need to specify a namespace foo/ before being able to tab-complete a pod's name right?

@superbrothers

This comment has been minimized.

Member

superbrothers commented Apr 14, 2018

@juanvallejo No. This completion completes filedirs, <namespace>/, and <pod-name>: of current namespace.

$ kubectl get po
NAME                   READY     STATUS    RESTARTS   AGE
nginx-8586cf59-8qxtc   1/1       Running   0          12s
nginx-8586cf59-scp9r   1/1       Running   0          41s
nginx-8586cf59-w6rnv   1/1       Running   0          12s
$ kubectl cp <tab><tab>
api/                           .dockerized-kube-version-defs  nginx-8586cf59-8qxtc:
.bazelrc                       docs/                          nginx-8586cf59-scp9r:
build/                         examples/                      nginx-8586cf59-w6rnv:
BUILD.bazel                    .generated_files               _output/
CHANGELOG-1.10.md              .git/                          OWNERS
CHANGELOG-1.2.md               .gitattributes                 OWNERS_ALIASES
CHANGELOG-1.3.md               .github/                       pkg/
CHANGELOG-1.4.md               .gitignore                     plugin/
CHANGELOG-1.5.md               Godeps/                        README.md
CHANGELOG-1.6.md               hack/                          staging/
CHANGELOG-1.7.md               .kazelcfg.json                 SUPPORT.md
CHANGELOG-1.8.md               kube-public/                   test/
CHANGELOG-1.9.md               kube-system/                   third_party/
CHANGELOG.md                   labels.yaml                    _tmp/
cluster/                       LICENSE                        translations/
cmd/                           logo/                          vendor/
code-of-conduct.md             .make/                         WORKSPACE
CONTRIBUTING.md                Makefile
default/                       Makefile.generated_files
@superbrothers

This comment has been minimized.

Member

superbrothers commented Apr 14, 2018

/test pull-kubernetes-integration

@cblecker

This comment has been minimized.

Member

cblecker commented Apr 18, 2018

@deads2k Any other concerns before approval?

@superbrothers

This comment has been minimized.

Member

superbrothers commented May 2, 2018

/test pull-kubernetes-integration
/test pull-kubernetes-e2e-gce

@superbrothers

This comment has been minimized.

Member

superbrothers commented May 3, 2018

1 similar comment
@cblecker

This comment has been minimized.

Member

cblecker commented May 8, 2018

@deads2k

This comment has been minimized.

Contributor

deads2k commented May 8, 2018

it looks plausible. I guess I'll trust it does good things. In big clusters, the general approach seems questionable.

/approve

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented May 8, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cblecker, deads2k, superbrothers

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

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented May 8, 2018

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented May 8, 2018

Automatic merge from submit-queue (batch tested with PRs 63526, 60371, 63444). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-merge-robot k8s-merge-robot merged commit e70c433 into kubernetes:master May 8, 2018

10 of 17 checks passed

Submit Queue Required Github CI test is not green: pull-kubernetes-e2e-gce
Details
pull-kubernetes-e2e-gce Job triggered.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job triggered.
Details
pull-kubernetes-e2e-kops-aws Job triggered.
Details
pull-kubernetes-integration Job triggered.
Details
pull-kubernetes-kubemark-e2e-gce Job triggered.
Details
pull-kubernetes-verify Job triggered.
Details
cla/linuxfoundation superbrothers authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gke Skipped
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-unit Context retired. Status moved to "pull-kubernetes-integration".
@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented May 8, 2018

@superbrothers: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-integration 8d58e70 link /test pull-kubernetes-integration
pull-kubernetes-e2e-gce 8d58e70 link /test pull-kubernetes-e2e-gce

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment