Skip to content

Commit

Permalink
Merge pull request terraform-google-modules#50 from ogreface/issue_43
Browse files Browse the repository at this point in the history
Issue 43: Fix issue with single zone, and update test for the problem.
  • Loading branch information
Jberlinsky committed Jan 8, 2019
2 parents 6b11e81 + 028bebe commit 2b8f4ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ locals {
}

cluster_type_output_regional_zones = "${concat(google_container_cluster.primary.*.additional_zones, list(list()))}"
cluster_type_output_zonal_zones = "${concat(google_container_cluster.zonal_primary.*.additional_zones, list(list()))}"
cluster_type_output_zonal_zones = "${concat(slice(var.zones,1,length(var.zones)), list(list()))}"

cluster_type_output_zones = {
regional = "${local.cluster_type_output_regional_zones[0]}"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/simple_zonal/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module "example" {
credentials_path = "${local.credentials_path}"
cluster_name_suffix = "-${random_string.suffix.result}"
region = "${var.region}"
zones = ["${var.zones}"]
zones = ["${slice(var.zones,0,1)}"]
network = "${google_compute_network.main.name}"
subnetwork = "${google_compute_subnetwork.main.name}"
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"
Expand Down
4 changes: 4 additions & 0 deletions test/integration/simple_zonal/controls/gcloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
expect(data['location']).to match(/^(.*)[1-9]-[a-z]$/)
end

it "is single zoned" do
expect(data['locations'].size).to eq 1
end

it "has the expected initial cluster version" do
expect(data['initialClusterVersion']).to eq "1.11.4-gke.13"
end
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ variable "region" {
variable "zones" {
type = "list"
description = "The zones to host the cluster in (optional if regional cluster / required if zonal)"
default = []
default = [""]
}

variable "network" {
Expand Down

0 comments on commit 2b8f4ad

Please sign in to comment.