diff options
Diffstat (limited to 'zsh/oh-my-zsh/plugins/microk8s')
-rw-r--r-- | zsh/oh-my-zsh/plugins/microk8s/README.md | 24 | ||||
-rw-r--r-- | zsh/oh-my-zsh/plugins/microk8s/microk8s.plugin.zsh | 82 |
2 files changed, 0 insertions, 106 deletions
diff --git a/zsh/oh-my-zsh/plugins/microk8s/README.md b/zsh/oh-my-zsh/plugins/microk8s/README.md deleted file mode 100644 index 2b4ea20..0000000 --- a/zsh/oh-my-zsh/plugins/microk8s/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# MicroK8s plugin - -This plugin provides completion and useful aliases for [MicroK8s](https://microk8s.io/). - -To use it, add `microk8s` to the plugins array in your zshrc file. - -```zsh -plugins=(... microk8s) -``` - -## Aliases - -| Alias | Command | Description | -|-------|------------------|----------------------------------------------------------------------------------------------------------| -| mco | microk8s.config | Shows the Kubernetes config file. | -| mct | microk8s.ctr | Interact with containerd CLI. | -| mdi | microk8s.disable | Disables an addon. | -| me | microk8s.enable | Enables an addon. | -| mh | microk8s.helm | Interact with Helm CLI. | -| mis | microk8s.istio | Interact with Istio CLI. | -| mk | microk8s.kubectl | Interact with Kubernetes CLI. | -| msp | microk8s.stop | Stops all Kubernetes services. | -| mst | microk8s.start | Starts MicroK8s after it is being stopped. | -| msts | microk8s.status | Provides an overview of the MicroK8s state (running / not running) as well as the set of enabled addons. |
\ No newline at end of file diff --git a/zsh/oh-my-zsh/plugins/microk8s/microk8s.plugin.zsh b/zsh/oh-my-zsh/plugins/microk8s/microk8s.plugin.zsh deleted file mode 100644 index 048a9ab..0000000 --- a/zsh/oh-my-zsh/plugins/microk8s/microk8s.plugin.zsh +++ /dev/null @@ -1,82 +0,0 @@ -# ---------------------------------------------------------- # -# Aliases and Completions for MicroK8s (https://microk8s.io) # -# Author: Shaun Tabone (https://github.com/xontab) # -# ---------------------------------------------------------- # - -# Helper function to cache and load completions -_microk8s_cache_completion() { - local cache="${ZSH_CACHE_DIR}/microk8s_$(echo $1)_completion" - if [[ ! -f $cache ]]; then - $2 $cache - fi - - [[ -f $cache ]] && source $cache -} - -# ---------------------------------------------------------- # -# microk8s.enable # -# ALIAS: me # -# ---------------------------------------------------------- # -_microk8s_enable_get_command_list() { - microk8s.enable --help | tail -n +7 | awk '{$1=$1;print}' -} - -_microk8s_enable() { - compadd -X "MicroK8s Addons" $(_microk8s_enable_get_command_list) -} - -compdef _microk8s_enable microk8s.enable -alias me='microk8s.enable' - -# ---------------------------------------------------------- # -# microk8s.disable # -# ALIAS: mdi # -# ---------------------------------------------------------- # -_microk8s_disable_get_command_list() { - microk8s.disable --help | tail -n +7 | awk '{$1=$1;print}' -} - -_microk8s_disable() { - compadd -X "MicroK8s Addons" $(_microk8s_disable_get_command_list) -} - -compdef _microk8s_disable microk8s.disable -alias mdi='microk8s.disable' - -# ---------------------------------------------------------- # -# microk8s.kubectl # -# ALIAS: mk # -# ---------------------------------------------------------- # -_microk8s_kubectl_completion() { - if [ $commands[microk8s.kubectl] ]; then - microk8s.kubectl 2>/dev/null >/dev/null && microk8s.kubectl completion zsh | sed 's/__start_kubectl kubectl/__start_kubectl microk8s.kubectl/g' >$1 - fi -} - -_microk8s_cache_completion 'kubectl' _microk8s_kubectl_completion - -alias mk='microk8s.kubectl' - -# ---------------------------------------------------------- # -# microk8s.helm # -# ALIAS: mh # -# ---------------------------------------------------------- # -_microk8s_helm_completion() { - if [ $commands[microk8s.helm] ]; then - microk8s.helm completion zsh | sed 's/__start_helm helm/__start_helm microk8s.helm/g' >$1 - fi -} - -_microk8s_cache_completion 'helm' _microk8s_helm_completion - -alias mh='microk8s.helm' - -# ---------------------------------------------------------- # -# Other Aliases # -# ---------------------------------------------------------- # -alias mco='microk8s.config' -alias mct='microk8s.ctr' -alias mis='microk8s.istio' -alias mst='microk8s.start' -alias msts='microk8s.status' -alias msp='microk8s.stop' |