This commit is contained in:
Jonas Forsberg 2021-11-12 13:00:12 +01:00
parent 397ff450de
commit a49a55f523
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9

View File

@ -13,6 +13,9 @@ function kubernetes_configs(){
for file in $(find "${KUBE_CONFIG_DIR}" -type f -name "$KUBE_CONFIG_EXTENTION"); do
export KUBECONFIG="$file:$KUBECONFIG"
done
if [[ $(command -v kubectl) ]];then
complete -W "$(kubectl config get-contexts -o name)" kuc
fi
}
kubernetes_configs
@ -25,9 +28,3 @@ function kuc(){
# use kubernetes context <param>
kubectl config use-context "$1"
}
#bash completion for function kuc
if [[ $(command -v kubectl) ]];then
complete -W "$(kubectl config get-contexts -o name)" kuc
fi