k8s-mgmt-pod/docker/profile/20-k8s-tools-completion.sh
Michael Trip df0eaf0a21
All checks were successful
Build k8s-mgmt-pod image / Build & Push (push) Successful in 1m23s
Add kubectx and kubens support to Dockerfile and bash completion scripts
2026-06-29 13:40:34 +02:00

27 lines
No EOL
639 B
Bash

#!/bin/sh
# Enable kubectl and helm completion for interactive bash sessions.
if [ -n "${BASH_VERSION:-}" ]; then
if [ -r /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
fi
if [ -r /etc/bash_completion.d/kubectl ]; then
. /etc/bash_completion.d/kubectl
fi
if [ -r /etc/bash_completion.d/helm ]; then
. /etc/bash_completion.d/helm
fi
if [ -r /etc/bash_completion.d/kubectx ]; then
. /etc/bash_completion.d/kubectx
fi
if [ -r /etc/bash_completion.d/kubens ]; then
. /etc/bash_completion.d/kubens
fi
fi
alias k=kubectl
complete -F __start_kubectl k