Skip to content

Commit e9992dd

Browse files
committed
pkg/steps/clusterinstall/template: GCP region from the cluster
I still wish the end-to-end suite pulled the region out of the cluster itself, but until it does, lean on the Infrastructure status [1] like we've been doing for AWS since openshift/release@bf0a271f5c (AWS e2e provider should identify zone and master and multizone, 2019-01-05, openshift/release#2507). The hard-coding I'm replacing here was fine until the GCP region became dynamic in 00ebab1 (pkg/steps/clusterinstall/template: Get region from Boskos lease, 2020-12-11, openshift#1527). [1]: https://github.com/openshift/api/blob/164a2fb63b5f12918c439a5a0a768aa911bcad99/config/v1/types_infrastructure.go#L327-L328
1 parent 239cdb9 commit e9992dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/steps/clusterinstall/template.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ objects:
311311
export KUBE_SSH_USER=core
312312
mkdir -p ~/.ssh
313313
cp /tmp/cluster/ssh-privatekey ~/.ssh/google_compute_engine || true
314-
export TEST_PROVIDER='{"type":"gce","region":"us-east1","multizone": true,"multimaster":true,"projectid":"openshift-gce-devel-ci"}'
314+
# TODO: make openshift-tests auto-discover this from cluster config
315+
REGION="$(oc get -o jsonpath='{.status.platformStatus.gcp.region}' infrastructure cluster)"
316+
export TEST_PROVIDER="{\"type\":\"gce\",\"region\":\"${REGION}\",\"multizone\": true,\"multimaster\":true,\"projectid\":\"openshift-gce-devel-ci\"}"
315317
elif [[ "${CLUSTER_TYPE}" == "aws" ]]; then
316318
mkdir -p ~/.ssh
317319
cp /tmp/cluster/ssh-privatekey ~/.ssh/kube_aws_rsa || true

0 commit comments

Comments
 (0)