convert h to original helm

This commit is contained in:
hophacker 2020-02-19 12:58:35 +08:00
parent 9c91b1b769
commit af089473bd
2 changed files with 18 additions and 13 deletions

View File

@ -324,4 +324,3 @@ endfunction
" set paste
nnoremap <localleader>tp :call TogglePaste()<cr>
nnoremap <localleader>tt :call ToggleRspecTest()<cr>

View File

@ -240,8 +240,7 @@ function kubectl() {
case $1 in
-c)
CONTEXT="$2"
shift
shift
shift; shift
;;
--context=*)
CONTEXT="${i#*=}"
@ -263,8 +262,7 @@ function stern {
case $1 in
-c)
CONTEXT="$2"
shift
shift
shift; shift
;;
--context=*)
CONTEXT="${i#*=}"
@ -279,15 +277,23 @@ function stern {
echo "stern $finalopts --kubeconfig=$HOME/.kube/${CONTEXT}_config"
command stern $finalopts -t --since 10m --kubeconfig=$HOME/.kube/${CONTEXT}_config
}
alias kg="k -c qcloud"
function h() {
function helm() {
CONTEXT=gcloud
while getopts ":c:" opt; do
case ${opt} in
c)
CONTEXT=$OPTARG
finalopts=()
while [[ $@ != "" ]] do
case $1 in
-c)
CONTEXT="$2"
shift; shift
;;
--context=*)
CONTEXT="${i#*=}"
shift
;;
*)
finalopts+=($1)
shift
;;
esac
done
TLS=""
@ -295,9 +301,9 @@ function h() {
gcloud)
TLS="--tls"
esac
helm $* $TLS --kubeconfig $HOME/.kube/${CONTEXT}_config
echo "helm $finalopts $TLS --kubeconfig=$HOME/.kube/${CONTEXT}_config"
command helm $finalopts $TLS --kubeconfig=$HOME/.kube/${CONTEXT}_config
}
alias hg="h -c qcloud"
function kexec {
RAN=false
CONTEXT=gcloud