diff --git a/zsh/functions.zsh b/zsh/functions.zsh index adfbc5a..ec4f0a7 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -284,29 +284,6 @@ function stern { echo "stern $finalopts --kubeconfig=$HOME/.kube/${KCONTEXT}_config" command stern $finalopts -t --since 10m --kubeconfig=$HOME/.kube/${KCONTEXT}_config } -function helm() { - DEBUG=false - finalopts=() - while [[ $@ != "" ]] do - case $1 in - --context=*) - KCONTEXT="${i#*=}" - shift - ;; - --debug) - DEBUG=true - finalopts+=($1) - shift - ;; - *) - finalopts+=($1) - shift - ;; - esac - done - [[ $DEBUG == "true" ]] && echo "helm $finalopts --kubeconfig=$HOME/.kube/${KCONTEXT}_config" - command helm $finalopts --kubeconfig=$HOME/.kube/${KCONTEXT}_config -} function rgm { args=("${(@s/,/)1}") diff --git a/zsh/k8s.zsh b/zsh/k8s.zsh index 4cb2a78..f2fc86f 100644 --- a/zsh/k8s.zsh +++ b/zsh/k8s.zsh @@ -1,7 +1,6 @@ NAMESPACE=default RUNNING_POD="" LEFT_ARGS="" -KCONTEXT="" VERBOSE=false SRC="" DST="" @@ -190,3 +189,27 @@ function set_k8s_context_core { fi export KCONTEXT=$C } + +function helm() { + DEBUG=false + finalopts=() + while [[ $@ != "" ]] do + case $1 in + --context=*) + KCONTEXT="${i#*=}" + shift + ;; + --debug) + DEBUG=true + finalopts+=($1) + shift + ;; + *) + finalopts+=($1) + shift + ;; + esac + done + [[ $DEBUG == "true" ]] && echo "helm $finalopts --kubeconfig=$HOME/.kube/${KCONTEXT}_config" + command helm $finalopts --kubeconfig=$HOME/.kube/${KCONTEXT}_config +}