summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-07-30 21:00:00 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-07-30 21:00:00 +0300
commit38a3ca7dc3d101fd598b65b72b55e6e82bb6654c (patch)
treeab5923bb667f26049e9dae86ca918d6ea8185633 /internal
parent59c32933713f077f767b495d0c2de0753d4a6bbc (diff)
support gke kubecontext clusters that are mapped to regions instead of zones
fixes #139
Diffstat (limited to 'internal')
-rwxr-xr-xinternal/p10k.zsh7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 5ca1bef1..62b4bf58 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -2921,11 +2921,12 @@ prompt_kubecontext() {
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
+ # gke_my-account_us-east1_cluster-01
+ if [[ $cluster == (#b)gke_(?*)_(asia|australia|europe|northamerica|southamerica|us)-([a-z]##<->)(-[a-z]|)_(?*) ]]; then
cloud_name=gke
cloud_account=$match[1]
- cloud_zone=$match[2]-$match[3]
- cloud_cluster=$match[4]
+ cloud_zone=$match[2]-$match[3]-$match[4]
+ cloud_cluster=$match[5]
if (( ${_POWERLEVEL9K_KUBECONTEXT_SHORTEN[(I)gke]} )); then
text=$cloud_cluster
fi