kubectx.plugin.zsh 318 B

1234567891011121314
  1. typeset -A kubectx_mapping
  2. function kubectx_prompt_info() {
  3. if [ $commands[kubectl] ]; then
  4. local current_ctx=`kubectl config current-context`
  5. #if associative array declared
  6. if [[ -n $kubectx_mapping ]]; then
  7. echo "${kubectx_mapping[$current_ctx]}"
  8. else
  9. echo $current_ctx
  10. fi
  11. fi
  12. }