From 60736c9f37ccf886291a5995dfc6f7215b0d8b56 Mon Sep 17 00:00:00 2001 From: Miral <13769268+MiralDesai@users.noreply.github.com> Date: Tue, 21 May 2019 23:13:05 +0100 Subject: [PATCH] Add new kubectl alias to list all contexts (#7823) * Add alias to list all contexts * Update readme to include new alias --- plugins/kubectl/README.md | 1 + plugins/kubectl/kubectl.plugin.zsh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index 3343f0195..0514d8f3f 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -22,6 +22,7 @@ plugins=(... kubectl) | kcsc | `kubectl config set-context` | Set a context entry in kubeconfig | | kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig | | kccc | `kubectl config current-context` | Display the current-context | +| kcgc | `kubectl config get-contexts` | List of contexts available | | | **General aliases** | | kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector | | kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index ab7a1a0a4..cf42beaea 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -28,6 +28,9 @@ alias kcsc='kubectl config set-context' alias kcdc='kubectl config delete-context' alias kccc='kubectl config current-context' +# List all contexts +alias kcgc='kubectl config get-contexts' + # General aliases alias kdel='kubectl delete' alias kdelf='kubectl delete -f'