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
Progress of the support of shell completion for the "kubectl cert-manager" plugin, coming in Kubernetes 1.24 #4657
Comments
Updates:
|
depending on: kubernetes/kubernetes#74178 see also: cert-manager/cert-manager#4657
Issues go stale after 90d of inactivity. |
Stale issues rot after 30d of inactivity. |
Rotten issues close after 30d of inactivity. |
@jetstack-bot: Closing this issue. In response to this:
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. |
It took longer but the support for completion for plugins has been merged and will be part of kubectl 1.26. |
Kubernetes 1.26 was released a few days ago, which means you can now use the # The following command assumes that ~/bin is in your PATH.
cat <<'EOF' >~/bin/kubectl_complete-cert_manager && chmod u+x ~/bin/kubectl_complete-cert_manager
#!/usr/bin/env sh
# https://github.com/kubernetes/kubernetes/pull/105867
kubectl cert-manager __complete "$@"
EOF My hope is that we will embed this Update: the above command is now officially documented in https://cert-manager.io/docs/reference/cmctl/#auto-completion-with-the-kubectl-plugin. |
Currently, the only way to get shell completion to work when using the cert-manager kubectl plugin is to skip the kubectl plugin mechanism altogether as it can be read on the Kubectl plugin:
In the last couple of weeks, there has been a promising effort for bringing completion support to kubectl plugins. Marc Khouzam proposed the kubectl PR 105867. Cobra also v1.3.0 comes a fix to get flag completion, see below explanation. These two changes should land in
kubectl
probably in Kubernetes 1.24.Here is what the completion will look like:
This issue tracks the progress of the kubectl plugin support for
kubectl cert-manager
.Plan:
krew
?Try the completion!
If you would like to test the completion support:
Add
~/bin
to your PATH. (optional, but the following steps assume that ~/bin is in your PATH).Install the patched
kubectl
(kubectl PR 105867 + replace cobra v1.2.1 with v1.3.0 to get PR 1161):Install the
kubectl cert-manager
plugin:Enable cert-manager plugin completion by creating the shim
kubectl_complete-cert_manager
:Kubectl, Cobra v1.2.1 vs. v1.3.0 and the flag completion bug
Currently,
kubectl
using PR 105867 does not support flag completion. When completing flags for a plugin such as cert-manager, you can see that nothing appears when completing:A fix for this bug was already merged in Cobra in PR 1161 released in cobra v1.3.0, and kubectl's go.mod still refers to cobra v1.2.1. In order to have the fix working, you need to update kubectl's go.mod to point cobra to
v1.3.0
.Then, you should see:
/kind feature
/area ctl
The text was updated successfully, but these errors were encountered: