Skip to content

Commit eeca20a

Browse files
authored
Merge pull request #50 from ogreface/issue_43
Issue 43: Fix issue with single zone, and update test for the problem.
2 parents ca6a586 + 8ec5679 commit eeca20a

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ locals {
5151
}
5252

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

5656
cluster_type_output_zones = {
5757
regional = "${local.cluster_type_output_regional_zones[0]}"

test/fixtures/simple_zonal/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module "example" {
2121
credentials_path = "${local.credentials_path}"
2222
cluster_name_suffix = "-${random_string.suffix.result}"
2323
region = "${var.region}"
24-
zones = ["${var.zones}"]
24+
zones = ["${slice(var.zones,0,1)}"]
2525
network = "${google_compute_network.main.name}"
2626
subnetwork = "${google_compute_subnetwork.main.name}"
2727
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"

test/integration/simple_zonal/controls/gcloud.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
expect(data['location']).to match(/^(.*)[1-9]-[a-z]$/)
4343
end
4444

45+
it "is single zoned" do
46+
expect(data['locations'].size).to eq 1
47+
end
48+
4549
it "has the expected initial cluster version" do
4650
expect(data['initialClusterVersion']).to eq "1.11.4-gke.13"
4751
end

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ variable "region" {
3939
variable "zones" {
4040
type = "list"
4141
description = "The zones to host the cluster in (optional if regional cluster / required if zonal)"
42-
default = []
42+
default = [""]
4343
}
4444

4545
variable "network" {

0 commit comments

Comments
 (0)