summaryrefslogtreecommitdiff
path: root/plugins/kubectx/kubectx.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2021-07-11 19:58:51 -0600
committerTuowen Zhao <ztuowen@gmail.com>2021-07-11 19:58:51 -0600
commit617ed3bd9f3d9519fe2354941f3dbf15b0c712ee (patch)
treecaf617b35d3f5f7b5786483eedfcda9361dca108 /plugins/kubectx/kubectx.plugin.zsh
parent0144641b7d8e4e6ff6ce153039b5a827f5347904 (diff)
parent36f444ed7325720ec05f182781ec7d6c9a4d675c (diff)
downloadzsh-617ed3bd9f3d9519fe2354941f3dbf15b0c712ee.tar.gz
zsh-617ed3bd9f3d9519fe2354941f3dbf15b0c712ee.tar.bz2
zsh-617ed3bd9f3d9519fe2354941f3dbf15b0c712ee.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/kubectx/kubectx.plugin.zsh')
-rw-r--r--plugins/kubectx/kubectx.plugin.zsh14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/kubectx/kubectx.plugin.zsh b/plugins/kubectx/kubectx.plugin.zsh
new file mode 100644
index 000000000..56b7217f1
--- /dev/null
+++ b/plugins/kubectx/kubectx.plugin.zsh
@@ -0,0 +1,14 @@
+typeset -A kubectx_mapping
+
+function kubectx_prompt_info() {
+ if [ $commands[kubectl] ]; then
+ local current_ctx=`kubectl config current-context`
+
+ #if associative array declared
+ if [[ -n $kubectx_mapping ]]; then
+ echo "${kubectx_mapping[$current_ctx]}"
+ else
+ echo $current_ctx
+ fi
+ fi
+}