When doing completion for arguments or flags for a plugin, kubectl will call "kubectl_complete-<plugin>" to obtain the list of completions. For example, for "krew" plugin, when the user triggers completion using: $ kubectl krew <tab><tab> kubectl will look for an executable file called "kubectl_complete-krew". This file should print the list of valid completions for the plugin to stdout. Using cobra.ShellCompDirective as the last line of the output is supported as is done by Cobra. We also clear global flags when doing plugin completion because plugins don't necessarily accept the global kubectl flags. If some plugins do, they will need to include such flags in their kubectl_complete-<plugin> output. Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca> Kubernetes-commit: befc8da7efa5d961d9ade4eadc706292c7ca5a64 |
||
|---|---|---|
| .github | ||
| docs | ||
| images | ||
| pkg | ||
| testdata | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| OWNERS | ||
| README.md | ||
| SECURITY_CONTACTS | ||
| code-of-conduct.md | ||
| doc.go | ||
| go.mod | ||
| go.sum | ||
README.md
Kubectl
The k8s.io/kubectl repo is used to track issues for the kubectl cli distributed
with k8s.io/kubernetes. It also contains packages intended for use by client
programs. E.g. these packages are vendored into k8s.io/kubernetes for use in
the kubectl
cli client. That client will eventually move here too.
Contribution Requirements
-
Full unit-test coverage.
-
Go tools compliant (
go get,go test, etc.). It needs to be vendorable somewhere else. -
No dependence on
k8s.io/kubernetes. Dependence on other repositories is fine. -
Code must be usefully commented. Not only for developers on the project, but also for external users of these packages.
-
When reviewing PRs, you are encouraged to use Golang's code review comments page.
-
Packages in this repository should aspire to implement sensible, small interfaces and import a limited set of dependencies.
Community, discussion, contribution, and support
See this document for how to reach the maintainers of this project.
Code of conduct
Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.
