(List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "This is NOT a production-ready tool."][\ LIT_ESCAPED_CHAR "\\n"][LIT_CHARS "IT'S A HACKY, BEST-EFFORT WAY TO "][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS STOP][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS " CREATION OF THE GKE CLUSTER."]]} ) (Com {[LIT_CHARS read]} {[LIT_CHARS -n]} {[LIT_CHARS 1]} {[LIT_CHARS -p]} {[DQ [LIT_CHARS "Are you sure you want to proceed (y/N)?: "]]} {[LIT_CHARS decision]} ) (Com {[LIT_CHARS echo]} {[DQ ]} ) (If (DBracket {B2 BINARY_STRING_NOT_EQUAL {[DQ [VarSub decision]]} {[DQ [LIT_CHARS y]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS Aborting...]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 0]} ) ) ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS errexit]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS nounset]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS pipefail]} ) (= scope= flags=0 words=[] bindings=[('KUBE_ROOT', {[ComSub (Com {[LIT_CHARS dirname]} {[DQ [VarSub BASH_SOURCE]]})] [LIT_CHARS /../..]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -f]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/env.sh]]} {[LIT_DBRACKET_LIKE "]"]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/env.sh]]} ) ) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/gke/util.sh]]} ) (= scope= flags=0 words=[] bindings=[('STAGING_ENDPOINT', {[DQ [LIT_CHARS "CLOUDSDK_API_ENDPOINT_OVERRIDES_CONTAINER=https://staging-container.sandbox.googleapis.com/"]]})]) (Com {[LIT_CHARS detect-project]} ) (= scope= flags=0 words=[] bindings=[('cluster', {[ComSub (AndOr OP_OR_IF (Pipeline (Com {[LIT_CHARS gcloud]} {[LIT_CHARS container]} {[LIT_CHARS operations]} {[LIT_CHARS list]} {[DQ [LIT_CHARS "--project="][VarSub PROJECT]]}) (Com {[LIT_CHARS grep]} {[DQ [LIT_CHARS CREATE_CLUSTER]]}) (Com {[LIT_CHARS grep]} {[DQ [LIT_CHARS RUNNING]]}) ) (Com {[LIT_CHARS true]}) )]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -z]} {[DQ [VarSub cluster]]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Couldn't find any cluster being created in production environment. Trying staging..."]]} ) (= scope= flags=0 words=[] bindings=[('cluster', {[ComSub (AndOr OP_OR_IF (Pipeline (Com {[LIT_CHARS env]} {[VarSub STAGING_ENDPOINT]} {[LIT_CHARS gcloud]} {[LIT_CHARS container]} {[LIT_CHARS operations]} {[LIT_CHARS list]} {[DQ [LIT_CHARS "--project="][VarSub PROJECT]]}) (Com {[LIT_CHARS grep]} {[DQ [LIT_CHARS CREATE_CLUSTER]]}) (Com {[LIT_CHARS grep]} {[DQ [LIT_CHARS RUNNING]]}) ) (Com {[LIT_CHARS true]}) )]})]) ) ) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -z]} {[DQ [VarSub cluster]]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "No cluster creation in progress found. Aborting."]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 0]} ) ) ) (= scope= flags=0 words=[] bindings=[('zone', {[ComSub (Pipeline (Com {[LIT_CHARS echo]} {[DQ [VarSub cluster]]}) (Com {[LIT_CHARS tr]} {[LIT_CHARS -s]} {[DQ [LIT_CHARS "[:blank:]"]]}) (Com {[LIT_CHARS cut]} {[LIT_CHARS -f3]} {[LIT_CHARS -d] [DQ [LIT_CHARS " "]]}) )]})]) (= scope= flags=0 words=[] bindings=[('cluster_name', {[ComSub (Pipeline (Com {[LIT_CHARS echo]} {[DQ [VarSub cluster]]}) (Com {[LIT_CHARS tr]} {[LIT_CHARS -s]} {[DQ [LIT_CHARS "[:blank:]"]]}) (Com {[LIT_CHARS cut]} {[LIT_CHARS -f4]} {[LIT_CHARS -d] [DQ [LIT_CHARS " "]]}) )]})]) (= scope= flags=0 words=[] bindings=[('gcloud', {[DQ [LIT_CHARS gcloud]]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[DQ [VarSub zone]]} {[LIT_DBRACKET_LIKE "=="]} {[DQ [LIT_CHARS us-east1-a]]} {[LIT_DBRACKET_LIKE "]"]} ) (= scope= flags=0 words=[] bindings=[('gcloud', {[DQ [LIT_CHARS "env "][VarSub STAGING_ENDPOINT][LIT_CHARS " gcloud"]]})]) ) (= scope= flags=0 words=[] bindings=[('migs', {[ComSub (Pipeline (Com {[VarSub gcloud]} {[LIT_CHARS compute]} {[LIT_CHARS instance-groups]} {[LIT_CHARS managed]} {[LIT_CHARS list]} {[LIT_CHARS --project] [LIT_DBRACKET_LIKE "="] [VarSub PROJECT]} {[LIT_CHARS --zones] [LIT_DBRACKET_LIKE "="] [VarSub zone]}) (Com {[LIT_CHARS grep]} {[DQ [LIT_CHARS gke-][VarSub cluster_name]]}) (Com {[LIT_CHARS cut]} {[LIT_CHARS -f1]} {[LIT_CHARS -d] [DQ [LIT_CHARS " "]]}) )]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Managed instance groups for cluster "][VarSub cluster_name][LIT_CHARS ": "][VarSub migs]]} ) (For mig [{[VarSub migs]}]) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Resizing "][VarSub mig][LIT_CHARS ...]]} ) (Com {[VarSub gcloud]} {[LIT_CHARS compute]} {[LIT_CHARS instance-groups]} {[LIT_CHARS managed]} {[LIT_CHARS resize]} {[LIT_CHARS --project] [LIT_DBRACKET_LIKE "="] [DQ [VarSub PROJECT]]} {[LIT_CHARS --zone] [LIT_DBRACKET_LIKE "="] [DQ [VarSub zone]]} {[DQ [VarSub mig]]} {[LIT_CHARS --size] [LIT_DBRACKET_LIKE "="] [LIT_CHARS 1]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "All managed instance groups resized to 1. Cluster creation operation should end soon, and you will be be able to delete the cluster."]]} ) )