diff options
author | Dan Davison <ddavison@gitlab.com> | 2019-07-09 22:41:38 +0000 |
---|---|---|
committer | Dan Davison <ddavison@gitlab.com> | 2019-07-09 22:41:38 +0000 |
commit | b9b602249236abe1401d49319cbe70a48f5c7c84 (patch) | |
tree | adfd795b055c27a591951a5ac167b4433b407a6e /qa | |
parent | 60decd47095e7faf31768e8ecc7a9f2965d6ceaf (diff) | |
parent | af7c98044e0c5809e2c8792b85ec8e2f14590a07 (diff) | |
download | gitlab-ce-b9b602249236abe1401d49319cbe70a48f5c7c84.tar.gz |
Merge branch 'qa-autodevops-rotate-gcp-zones' into 'master'
Allow specificity for GKE Cluster Location
See merge request gitlab-org/gitlab-ce!30490
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/runtime/env.rb | 4 | ||||
-rw-r--r-- | qa/qa/service/kubernetes_cluster.rb | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index d50f618ff82..e78b9bece19 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -177,8 +177,8 @@ module QA ENV.fetch("GCLOUD_ACCOUNT_EMAIL") end - def gcloud_zone - ENV.fetch('GCLOUD_ZONE') + def gcloud_region + ENV.fetch('GCLOUD_REGION') end def has_gcloud_credentials? diff --git a/qa/qa/service/kubernetes_cluster.rb b/qa/qa/service/kubernetes_cluster.rb index 16a89591eb2..40263e94065 100644 --- a/qa/qa/service/kubernetes_cluster.rb +++ b/qa/qa/service/kubernetes_cluster.rb @@ -28,17 +28,17 @@ module QA create #{cluster_name} #{auth_options} --enable-basic-auth - --zone #{Runtime::Env.gcloud_zone} + --region #{Runtime::Env.gcloud_region} && gcloud container clusters get-credentials - --zone #{Runtime::Env.gcloud_zone} + --region #{Runtime::Env.gcloud_region} #{cluster_name} CMD @api_url = `kubectl config view --minify -o jsonpath='{.clusters[].cluster.server}'` @admin_user = "#{cluster_name}-admin" - master_auth = JSON.parse(`gcloud container clusters describe #{cluster_name} --zone #{Runtime::Env.gcloud_zone} --format 'json(masterAuth.username, masterAuth.password)'`) + master_auth = JSON.parse(`gcloud container clusters describe #{cluster_name} --region #{Runtime::Env.gcloud_region} --format 'json(masterAuth.username, masterAuth.password)'`) shell <<~CMD.tr("\n", ' ') kubectl config set-credentials #{@admin_user} --username #{master_auth['masterAuth']['username']} @@ -66,10 +66,10 @@ module QA def remove! shell <<~CMD.tr("\n", ' ') gcloud container clusters delete - --zone #{Runtime::Env.gcloud_zone} - #{cluster_name} - --quiet --async - CMD + --region #{Runtime::Env.gcloud_region} + #{cluster_name} + --quiet --async + CMD end private |