Skip to content

module region output can be blank, breaking tests #309

Closed
@ideasculptor

Description

@ideasculptor

Looks like the region output of the beta_private_cluster module (computed from a local.cluster_output_region, assigned as cluster_output_region = google_container_cluster.primary.region) can be null. This potentially breaks tests.

The case that I exercised was as follows:

regional = false
region = 'us-east4'
zones = ['us-east4-a']

According to the documentation of the google_container_cluster resource, the region attribute is deprecated, and will only have a value if the cluster is regional instead of zonal. The module should be computing the region from the location (zone), in a zonal cluster, if it is going to output a region - since tests for the with_network examples require a region. Location will contain the region in a regional cluster.

I fixed the private_zonal_with_network example by using the incoming variable as the output value instead of retrieving it from the resource attribute.

Metadata

Metadata

Assignees

Labels

P2high priority issuesbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions