Skip to content

Commit

Permalink
Update kubernetes.zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
LucEast authored Jun 21, 2024
1 parent 0dafa12 commit 5c28138
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions common/.zsh/kubernetes.zsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Alias für kubectl
alias k=kubectl
complete -F __start_kubectl k

alias kx='f() { [ \"\$1\" ] && kubectl config use-context \$1 || kubectl config current-context ; } ; f'
alias kn='f() { [ \"\$1\" ] && kubectl config set-context --current --namespace \$1 || kubectl config view --minify | grep namespace | cut -d\" \" -f6 ; } ; f'
# Autokomplettierung für kubectl
autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
source <(kubectl completion zsh)
compdef k=kubectl

# Alias für das Wechseln des Kontexts
alias kx='f() { [ "$1" ] && kubectl config use-context $1 || kubectl config current-context ; } ; f'

# Alias für das Setzen des Namespaces
alias kn='f() { [ "$1" ] && kubectl config set-context --current --namespace $1 || kubectl config view --minify | grep namespace | cut -d" " -f2 ; } ; f'

0 comments on commit 5c28138

Please sign in to comment.