summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-06-08 10:51:25 +0000
committerDylan Griffith <dyl.griffith@gmail.com>2018-06-08 14:20:59 +0200
commit5512c214de2fa1d67a56e387ea73a12858e1d6ab (patch)
treeeece7a89315647bd9003d5f06e9ab7cfffbd3fac /qa
parent2c05c8574f9bdef89008381754aee9566b58ad86 (diff)
downloadgitlab-ce-5512c214de2fa1d67a56e387ea73a12858e1d6ab.tar.gz
Ensure --zone is passed to all gcloud commands for auto devops cluster specs
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/service/kubernetes_cluster.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/qa/qa/service/kubernetes_cluster.rb b/qa/qa/service/kubernetes_cluster.rb
index 604bc522983..71dcad7ed57 100644
--- a/qa/qa/service/kubernetes_cluster.rb
+++ b/qa/qa/service/kubernetes_cluster.rb
@@ -20,9 +20,11 @@ module QA
gcloud container clusters
create #{cluster_name}
--enable-legacy-authorization
- --zone us-central1-a
+ --zone #{gcloud_zone}
&& gcloud container clusters
- get-credentials #{cluster_name}
+ get-credentials
+ --zone #{gcloud_zone}
+ #{cluster_name}
CMD
@api_url = `kubectl config view --minify -o jsonpath='{.clusters[].cluster.server}'`
@@ -32,7 +34,12 @@ module QA
end
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
private
@@ -61,6 +68,10 @@ module QA
ensure
gcloud_account_key && gcloud_account_key.unlink
end
+
+ def gcloud_zone
+ ENV.fetch('GCLOUD_ZONE')
+ end
end
end
end