From a49a55f5238f21b2e8c0aefeda6df39515ddbc84 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Fri, 12 Nov 2021 13:00:12 +0100 Subject: [PATCH] . --- .functions/kubernetes.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.functions/kubernetes.sh b/.functions/kubernetes.sh index eb66cd7..0c6fad0 100644 --- a/.functions/kubernetes.sh +++ b/.functions/kubernetes.sh @@ -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 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 -