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

Move shell completion generation into 'kubectl completion' command #23801

Merged
merged 2 commits into from May 30, 2016

Conversation

Projects
None yet
10 participants
@sttts
Contributor

sttts commented Apr 3, 2016

Remove static shell completion scripts from the repo and add completion command to kubectl:

$ source <(kubectl completion bash)

or

$ source <(kubectl completion zsh)

This makes maintenance easier because no static scripts must be generated and committed anymore in the repo.

Moreover, kubectl is self-contained again for the user including the latest completion code. I am thinking about the use-case of updating kubectl via gcloud (or some package manager). The completion code is always in-sync, without the need to download a contrib/completion/bash/kubectl file from github.

Opinions are welcome /cc @eparis @nak3

Fixes openshift/origin#5290


This change is Reviewable

@eparis

This comment has been minimized.

Show comment
Hide comment
@eparis

eparis Apr 3, 2016

Member

should any of the zsh glue stuff move into the cobra repo, for others?

Member

eparis commented Apr 3, 2016

should any of the zsh glue stuff move into the cobra repo, for others?

@sttts

This comment has been minimized.

Show comment
Hide comment
@sttts

sttts Apr 3, 2016

Contributor

Very good question. I reimplement a number of missing functions that are not part of the zsh completion environment to make it work, of course only as far as necessary for kubectl. This is not really a "just-works" situation for other programs based on cobra, depending especially on custom functions.

Let me check in detail.

Contributor

sttts commented Apr 3, 2016

Very good question. I reimplement a number of missing functions that are not part of the zsh completion environment to make it work, of course only as far as necessary for kubectl. This is not really a "just-works" situation for other programs based on cobra, depending especially on custom functions.

Let me check in detail.

@janetkuo

This comment has been minimized.

Show comment
Hide comment
@janetkuo

janetkuo May 6, 2016

Member

@kubernetes/kubectl

Member

janetkuo commented May 6, 2016

@kubernetes/kubectl

@eparis

This comment has been minimized.

Show comment
Hide comment
@eparis

eparis May 9, 2016

Member

@sttts are you going to rebase this? did we land all the pre-reqs?

Member

eparis commented May 9, 2016

@sttts are you going to rebase this? did we land all the pre-reqs?

@eparis eparis assigned eparis and unassigned thockin May 9, 2016

@sttts

This comment has been minimized.

Show comment
Hide comment
@sttts

sttts May 9, 2016

Contributor

@eparis will rebase

Contributor

sttts commented May 9, 2016

@eparis will rebase

@eparis

This comment has been minimized.

Show comment
Hide comment
@eparis

eparis May 9, 2016

Member

@ingvagabund @liggitt @deads2k please CC anyone else you know of who might get bitten by this....

Member

eparis commented May 9, 2016

@ingvagabund @liggitt @deads2k please CC anyone else you know of who might get bitten by this....

@eparis eparis added the lgtm label May 9, 2016

@smarterclayton

This comment has been minimized.

Show comment
Hide comment
@smarterclayton

smarterclayton May 9, 2016

Contributor

@fabianofranz

On Mon, May 9, 2016 at 2:53 PM, Kubernetes Bot notifications@github.com
wrote:

GCE e2e build/test failed for commit 715e5d3
715e5d3
.

Please reference the list of currently known flakes
https://github.com/kubernetes/kubernetes/issues?q=is:issue+label:kind/flake+is:open
when examining this failure. If you request a re-test, you must reference
the issue describing the flake.


You are receiving this because you are on a team that was mentioned.
Reply to this email directly or view it on GitHub
#23801 (comment)

Contributor

smarterclayton commented May 9, 2016

@fabianofranz

On Mon, May 9, 2016 at 2:53 PM, Kubernetes Bot notifications@github.com
wrote:

GCE e2e build/test failed for commit 715e5d3
715e5d3
.

Please reference the list of currently known flakes
https://github.com/kubernetes/kubernetes/issues?q=is:issue+label:kind/flake+is:open
when examining this failure. If you request a re-test, you must reference
the issue describing the flake.


You are receiving this because you are on a team that was mentioned.
Reply to this email directly or view it on GitHub
#23801 (comment)

@eparis

This comment has been minimized.

Show comment
Hide comment
@eparis

eparis May 9, 2016

Member
build/common.sh:    contrib/completions/bash/kubectl
build/common.sh:  mkdir -p "${release_stage}/contrib/completions/bash"
build/common.sh
Member

eparis commented May 9, 2016

build/common.sh:    contrib/completions/bash/kubectl
build/common.sh:  mkdir -p "${release_stage}/contrib/completions/bash"
build/common.sh

@k8s-merge-robot k8s-merge-robot removed the lgtm label May 9, 2016

@sttts sttts added lgtm and removed lgtm labels May 25, 2016

@sttts

This comment has been minimized.

Show comment
Hide comment
@sttts

sttts May 25, 2016

Contributor

Rebased.

Contributor

sttts commented May 25, 2016

Rebased.

@sttts sttts added this to the v1.3 milestone May 25, 2016

@sttts

This comment has been minimized.

Show comment
Hide comment
@sttts

sttts May 25, 2016

Contributor

@k8s-bot test this issue: #25967

Contributor

sttts commented May 25, 2016

@k8s-bot test this issue: #25967

@sttts

This comment has been minimized.

Show comment
Hide comment
@sttts

sttts May 27, 2016

Contributor

@k8s-bot test this issue: #26403

Contributor

sttts commented May 27, 2016

@k8s-bot test this issue: #26403

@sttts sttts added lgtm and removed lgtm labels May 30, 2016

@k8s-merge-robot

This comment has been minimized.

Show comment
Hide comment
@k8s-merge-robot

k8s-merge-robot May 30, 2016

Contributor

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

Contributor

k8s-merge-robot commented May 30, 2016

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot

This comment has been minimized.

Show comment
Hide comment
@k8s-bot

k8s-bot commented May 30, 2016

GCE e2e build/test passed for commit 9e25d9f.

@k8s-merge-robot

This comment has been minimized.

Show comment
Hide comment
@k8s-merge-robot

k8s-merge-robot May 30, 2016

Contributor

Automatic merge from submit-queue

Contributor

k8s-merge-robot commented May 30, 2016

Automatic merge from submit-queue

@k8s-merge-robot k8s-merge-robot merged commit 270e859 into kubernetes:master May 30, 2016

4 of 5 checks passed

Submit Queue Github CI tests are not green.
Details
Jenkins GCE Node e2e Build finished.
Details
Jenkins GCE e2e 309 tests run, 126 skipped, 0 failed.
Details
Jenkins unit/integration 6472 tests run, 26 skipped, 0 failed.
Details
cla/google All necessary CLAs are signed
@sttts

This comment has been minimized.

Show comment
Hide comment
@sttts

sttts May 30, 2016

Contributor

Amen.

Contributor

sttts commented May 30, 2016

Amen.

@sttts sttts deleted the sttts:sttts-kubectl-completion-cmd branch May 30, 2016

@tksm tksm referenced this pull request Jul 5, 2016

Closed

kubernetes-cli 1.3.0 (stable), 1.4.0-alpha.0 (devel) #2731

3 of 4 tasks complete

xingzhou added a commit to xingzhou/official.kubernetes.github.io that referenced this pull request Aug 25, 2016

Updated kubectl bash completion usage in the doc.
We have moved the shell script into `kubectl completion` command in [#23801](kubernetes/kubernetes#23801), updated the bash completion usage in the doc.

Fixes kubernetes#1092

xingzhou added a commit to xingzhou/official.kubernetes.github.io that referenced this pull request Aug 29, 2016

Updated kubectl bash completion usage in the doc.
We have moved the shell script into `kubectl completion` command in [#23801](kubernetes/kubernetes#23801), updated the bash completion usage in the doc.

Fixes kubernetes#1092

xingzhou added a commit to xingzhou/official.kubernetes.github.io that referenced this pull request Aug 30, 2016

Updated kubectl bash completion usage in the doc.
We have moved the shell script into `kubectl completion` command in [#23801](kubernetes/kubernetes#23801), updated the bash completion usage in the doc.

Fixes kubernetes#1092

devin-donnelly added a commit to kubernetes/website that referenced this pull request Aug 30, 2016

Updated kubectl bash completion usage in the doc. (#1093)
We have moved the shell script into `kubectl completion` command in [#23801](kubernetes/kubernetes#23801), updated the bash completion usage in the doc.

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