diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-07-30 10:38:27 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-07-30 10:38:27 +0300 |
commit | 7cf4f7e57df2729a9ced345033123467d8439cd9 (patch) | |
tree | aee2602bb525eb4f449b623f811da712df1c2de3 /internal/p10k.zsh | |
parent | 32421d296c5b77f25ba69eeacd32f58dcff6cb81 (diff) |
ensure kubecontext namespace is not empty
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-x | internal/p10k.zsh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 6c852963..853bb64e 100755 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2918,6 +2918,7 @@ prompt_kubecontext() { done } if [[ -n $name ]]; then + : ${namespace:=default} # gke_my-account_us-east1-a_cluster-01 if [[ $cluster == (#b)gke_(?*)_(asia|australia|europe|northamerica|southamerica|us)-([a-z]##<->-[a-z])_(?*) ]]; then cloud_name=gke @@ -2939,9 +2940,8 @@ prompt_kubecontext() { fi if [[ -z $text ]]; then text=$name - local ns=${namespace:-default} - if [[ $_POWERLEVEL9K_KUBECONTEXT_SHOW_DEFAULT_NAMESPACE == 1 || $ns != (default|$name) ]]; then - text+="/$ns" + if [[ $_POWERLEVEL9K_KUBECONTEXT_SHOW_DEFAULT_NAMESPACE == 1 || $namespace != (default|$name) ]]; then + text+="/$namespace" fi fi local pat class |