diff options
author | venyii <codesguard@cersei.de> | 2019-07-05 02:10:26 +0300 |
---|---|---|
committer | venyii <codesguard@cersei.de> | 2019-07-05 20:26:00 +0300 |
commit | a9d99c9cab69bd52edd3584ea426d8dacd6e8929 (patch) | |
tree | a1eba68b0b7c7e32114b4851b9a9944f659bbbf2 /internal | |
parent | 214d12b27581f29ad1d8807e57bf8818160ef61b (diff) |
Add ability to provide a cluster function in kubecontext segment
This makes it possible to customize the displayed cluster name, e.g.
`gke_project-name-1337_europe-west1-c_production` -> `production`
Diffstat (limited to 'internal')
-rwxr-xr-x | internal/p10k.zsh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 825fd772..a1cbe3e0 100755 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2126,6 +2126,9 @@ prompt_kubecontext() { fi done fi + if [[ -n $POWERLEVEL9K_KUBECONTEXT_CONTEXT_FUNCTION ]]; then + ctx=$($POWERLEVEL9K_KUBECONTEXT_CONTEXT_FUNCTION $ctx) + fi _p9k_cache_set "$ctx" "$suf" fi |