clear and fix docker k8s related functions

This commit is contained in:
hophacker 2021-10-12 02:34:26 +08:00
parent 30385f388e
commit fb09350b42
2 changed files with 24 additions and 24 deletions

View File

@ -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}")

View File

@ -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
}