File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ locals {
4343 custom_kube_dns_config = length (keys (var. stub_domains )) > 0
4444 upstream_nameservers_config = length (var. upstream_nameservers ) > 0
4545 network_project_id = var.network_project_id != " " ? var.network_project_id : var.project_id
46+ zone_count = length (var. zones )
4647
4748 cluster_type = var.regional ? " regional" : " zonal"
4849
@@ -84,7 +85,7 @@ locals {
8485 }
8586
8687 cluster_type_output_regional_zones = flatten (google_container_cluster. primary . * . node_locations )
87- cluster_type_output_zonal_zones = slice (var. zones , 1 , length (var . zones ))
88+ cluster_type_output_zonal_zones = local.zone_count > 1 ? slice (var. zones , 1 , local . zone_count ) : []
8889
8990 cluster_type_output_zones = {
9091 regional = local.cluster_type_output_regional_zones
@@ -306,7 +307,7 @@ data "google_container_engine_versions" "zone" {
306307 //
307308 // data.google_container_engine_versions.zone: Cannot determine zone: set in this resource, or set provider-level zone.
308309 //
309- zone = var.zones[ 0 ] == " " ? data.google_compute_zones.available.names[0 ] : var.zones[0 ]
310+ zone = local.zone_count == 0 ? data.google_compute_zones.available.names[0 ] : var.zones[0 ]
310311
311312 project = var.project_id
312313}
You can’t perform that action at this time.
0 commit comments