diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2020-10-21 16:57:03 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2020-10-21 16:57:03 -0600 |
commit | 058885f5263f29f046c96ea2ecf55e6dca3ed321 (patch) | |
tree | 5aca868fa5f9d16f39baa0c355f6056b5c8ea4da /plugins/kubectl/kubectl.plugin.zsh | |
parent | 1774c426de3c4845e2d606c813c37067b8cf78d7 (diff) | |
parent | 3b1699b59527ee8095397b9909a37d55689a0481 (diff) | |
download | zsh-058885f5263f29f046c96ea2ecf55e6dca3ed321.tar.gz zsh-058885f5263f29f046c96ea2ecf55e6dca3ed321.tar.bz2 zsh-058885f5263f29f046c96ea2ecf55e6dca3ed321.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/kubectl/kubectl.plugin.zsh')
-rw-r--r-- | plugins/kubectl/kubectl.plugin.zsh | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 647d029c1..d509d8795 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -1,7 +1,7 @@ if (( $+commands[kubectl] )); then __KUBECTL_COMPLETION_FILE="${ZSH_CACHE_DIR}/kubectl_completion" - if [[ ! -f $__KUBECTL_COMPLETION_FILE ]]; then + if [[ ! -f $__KUBECTL_COMPLETION_FILE || ! -s $__KUBECTL_COMPLETION_FILE ]]; then kubectl completion zsh >! $__KUBECTL_COMPLETION_FILE fi @@ -150,3 +150,31 @@ alias kepvc='kubectl edit pvc' alias kdpvc='kubectl describe pvc' alias kdelpvc='kubectl delete pvc' +# Service account management. +alias kgsa="kubectl get sa" +alias kdsa="kubectl describe sa" +alias kdelsa="kubectl delete sa" + +# DaemonSet management. +alias kgds='kubectl get daemonset' +alias kgdsw='kgds --watch' +alias keds='kubectl edit daemonset' +alias kdds='kubectl describe daemonset' +alias kdelds='kubectl delete daemonset' + +# CronJob management. +alias kgcj='kubectl get cronjob' +alias kecj='kubectl edit cronjob' +alias kdcj='kubectl describe cronjob' +alias kdelcj='kubectl delete cronjob' + +# Only run if the user actually has kubectl installed +if (( ${+_comps[kubectl]} )); then + kj() { kubectl "$@" -o json | jq; } + kjx() { kubectl "$@" -o json | fx; } + ky() { kubectl "$@" -o yaml | yh; } + + compdef kj=kubectl + compdef kjx=kubectl + compdef ky=kubectl +fi |