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

Support completion for kubectl cp #60371

Merged
merged 1 commit into from
May 8, 2018

Conversation

superbrothers
Copy link
Member

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.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 24, 2018
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 24, 2018
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
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 24, 2018
@cblecker cblecker self-assigned this Feb 24, 2018
@cblecker
Copy link
Member

cblecker commented Apr 3, 2018

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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 3, 2018
@deads2k
Copy link
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
Copy link
Contributor

soltysh commented Apr 10, 2018

/assign @juanvallejo

@juanvallejo
Copy link
Contributor

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
Copy link
Member Author

@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
Copy link
Member Author

/test pull-kubernetes-integration

@cblecker
Copy link
Member

@deads2k Any other concerns before approval?

@superbrothers
Copy link
Member Author

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

@superbrothers
Copy link
Member Author

ping @deads2k @eparis

1 similar comment
@cblecker
Copy link
Member

cblecker commented May 8, 2018

ping @deads2k @eparis

@deads2k
Copy link
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
Copy link
Contributor

[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-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2018
@k8s-github-robot
Copy link

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

@k8s-github-robot
Copy link

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-github-robot k8s-github-robot merged commit e70c433 into kubernetes:master May 8, 2018
@k8s-ci-robot
Copy link
Contributor

@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
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubectl cp doesn't feature tab completion
7 participants