Commit 5512c214 authored by Dylan Griffith's avatar Dylan Griffith

Ensure --zone is passed to all gcloud commands for auto devops cluster specs

parent 2c05c857
...@@ -20,9 +20,11 @@ module QA ...@@ -20,9 +20,11 @@ module QA
gcloud container clusters gcloud container clusters
create #{cluster_name} create #{cluster_name}
--enable-legacy-authorization --enable-legacy-authorization
--zone us-central1-a --zone #{gcloud_zone}
&& gcloud container clusters && gcloud container clusters
get-credentials #{cluster_name} get-credentials
--zone #{gcloud_zone}
#{cluster_name}
CMD CMD
@api_url = `kubectl config view --minify -o jsonpath='{.clusters[].cluster.server}'` @api_url = `kubectl config view --minify -o jsonpath='{.clusters[].cluster.server}'`
...@@ -32,7 +34,12 @@ module QA ...@@ -32,7 +34,12 @@ module QA
end end
def remove! def remove!
shell("gcloud container clusters delete #{cluster_name} --quiet --async") shell <<~CMD.tr("\n", ' ')
gcloud container clusters delete
--zone #{gcloud_zone}
#{cluster_name}
--quiet --async
CMD
end end
private private
...@@ -61,6 +68,10 @@ module QA ...@@ -61,6 +68,10 @@ module QA
ensure ensure
gcloud_account_key && gcloud_account_key.unlink gcloud_account_key && gcloud_account_key.unlink
end end
def gcloud_zone
ENV.fetch('GCLOUD_ZONE')
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment