-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds workaround for data.google_compute_zones.available weirdness #788
Adds workaround for data.google_compute_zones.available weirdness #788
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-e2e-in-kind |
have you tested it in region |
It correctly returns $ cat main.tf
variable "region" {
default = "us-west1"
}
variable "project" { default = "jacob-operator" }
provider "google" {
project = var.project
region = var.region
credentials = file("/path/to/credentials/file.json")
}
data "google_compute_zones" "available" {}
output "zones" {
value = "${data.google_compute_zones.available.names}"
}
output "length" {value=length(data.google_compute_zones.available.names)}
$ terraform apply -var 'region=us-central1'
data.google_compute_zones.available: Refreshing state...
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
length = 4
zones = [
"us-central1-a",
"us-central1-b",
"us-central1-c",
"us-central1-f",
] |
/run-e2e-in-kind |
this place may not be right tidb-operator/deploy/modules/gcp/tidb-cluster/main.tf Lines 134 to 136 in 89d41bd
the default number of zones of the regional cluster is three but we will create I guess we need to use the number of
|
So even in us-central1, a regional cluster will still have 3 zones by default? Will the |
yes, by default it will choose 3 from all available zones (4 in
It works too. This command retrieves the |
What problem does this PR solve?
returns
5
forus-west1
.What is changed and how does it work?
In
deploy/modules/gcp/tidb-cluster/main.tf
switches towhich correctly reteurns
3
Check List
Tests
Manual test (add detailed scripts or steps below):
terraform apply
terraform destroy
Code changes
Related changes
Does this PR introduce a user-facing change?: