Closed abiwot closed 2 hours ago
@dosu
Step 2 is incorrect.
There is no option kubectl cert-manager completion bash
when cmctl is used as kubectl plugin. The only option is kubectl
.
Even when this is corrected, the original error reported still exist.
@dosu
Step 3 is incorrect.
There is no option cmctl completion kubectl
The only options when when /usr/local/bin/cmtl is used (not a kubectl plugin) is:
@dosu You made a good attempt to resolve this but you are referring to a solution that is already flagged as incorrect. It seems you are in a logical loop. You need to raise this issue to your "creator"
Sorry for the bot, it does not work as expected. I removed it and its comments.
The kubectl cert-manager completion kubectl --help
command should provide you with the following instructions to setup shell completion:
To load completions:
$ kubectl cert-manager completion kubectl > kubectl_complete-cert_manager
$ sudo install kubectl_complete-cert_manager /usr/local/bin
...
@inteon Thanks for the clarification. I needed to go one level deeper with the --help command. I figured it was a user error. tx
Resolution: (see comment above) https://github.com/cert-manager/cmctl/issues/123#issuecomment-2363931312
How to get cmctl shell completion working when used as kubectl plugin
Trying to get the cmctl shell completion to work when installed as the kubectl plugin (kubectl cert-manager TAB). I think I need some clarification around exactly what needs to be done.
Environment:
kubectl shell completion steps:
sudo apt install -y bash-completion
echo "source <(kubectl completion bash)" >> $HOME/.bashrc
source $HOME/.bashrc
Reproduce:
OS=$(uname -s | tr A-Z a-z); ARCH=$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/'); curl -fsSL -o cmctl https://github.com/cert-manager/cmctl/releases/latest/download/cmctl_${OS}_${ARCH}
chmod +x cmctl
sudo mv cmctl /usr/local/bin/kubectl-cert_manager
kubectl cert-manager completion kubectl
OUTPUT:
Attempted:
echo "source <(kubectl cert-manager completion kubectl)" >> $HOME/.bashrc
kubectl cert-manager completion kubectl | sudo tee /etc/bash_completion.d/kubectl-cert_manager
ERROR: