kubectx.plugin.zsh 306 B

123456789
  1. typeset -A kubectx_mapping
  2. function kubectx_prompt_info() {
  3. if [ $commands[kubectl] ]; then
  4. local current_ctx=`kubectl config current-context`
  5. # use value in associative array if it exists, otherwise fall back to the context name
  6. echo "${kubectx_mapping[$current_ctx]:-$current_ctx}"
  7. fi
  8. }