1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-11 00:00:06 +00:00

support gke kubecontext clusters that are mapped to regions instead of zones

fixes #139
This commit is contained in:
romkatv 2019-07-30 20:00:00 +02:00
parent 59c3293371
commit 38a3ca7dc3

View file

@ -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