This commit is contained in:
hophacker 2020-10-20 13:28:38 +08:00
parent c882cb2494
commit eeebaf5c63
3 changed files with 6 additions and 6 deletions

View File

@ -260,3 +260,4 @@ alias edit_alias="vim $yadr_zsh/aliases.zsh $yadr_zsh/functions.zsh -p"
alias docker_purge='docker stop $(docker ps -qa);docker rm $(docker ps -qa)'
alias yarn_sass="SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ yarn"
alias vim="nvim"
alias k="kubectl"

View File

@ -298,7 +298,7 @@ function helm() {
command helm $finalopts --kubeconfig=$HOME/.kube/${KCONTEXT}_config
}
function kexec {
RAN=false
RAN=true
NAMESPACE=default
finalopts=()
while [[ $@ != "" ]] do
@ -307,8 +307,8 @@ function kexec {
KCONTEXT="${i#*=}"
shift
;;
-r)
RAN=true
-R)
RAN=false
shift
;;
-p)
@ -373,8 +373,8 @@ function kexec {
fi
done
if [[ $RUNNING_POD_INDEX != -1 ]]; then
echo "kubectl exec -it $RUNNING_PODS[$RUNNING_POD_INDEX] $finalopts"
kubectl -n $NAMESPACE exec -it $RUNNING_PODS[$RUNNING_POD_INDEX] $finalopts
echo "kubectl -it -n $NAMESPACE exec $RUNNING_PODS[$RUNNING_POD_INDEX] -- $finalopts"
kubectl -it -n $NAMESPACE exec $RUNNING_PODS[$RUNNING_POD_INDEX] -- $finalopts
fi
}

View File

@ -86,4 +86,3 @@ function set_k8s_context {
export KCONTEXT=$C
prompt_skwp_setup
}
prompt_skwp_setup "$@"