-
Notifications
You must be signed in to change notification settings - Fork 982
Issue with var.vpc_config.secondary_range_*
in gke-cluster-*
modules
#1677
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
Comments
var.vpc_config.secondary_range_*
in gke-cluster-*
modules.var.vpc_config.secondary_range_*
in gke-cluster-*
modules
Good catch. I'll prep a PR later today. I think we only have to change the type of the |
@juliocc just for giggles – this is how I actually discovered the issue reported here 😅 project_id = "indecent-pigeon"
location = "europe-west4"
name = "test-cluster-9"
vpc_config = {
network = "cluster-net"
subnetwork = "cluster-net"
secondary_range_blocks = {
pods = ""
services = "/20" # can be an empty string as well
}
} This is a legit configuration and it works if there is no duplicate Source: It offends my sense of aesthetics though 😆 |
Interesting. #1678 should cover that use case, I've added an example for it. |
I believe the following applies both to
gke-cluster-standard
andgke-cluster-autopilot
.I was trying to use the optional
secondary_range_blocks
field of the input variablevpc_config
.Here's my
modules/gke-cluster-standard/terraform.tfvars
for testing:The issue here is that
secondary_range_names
has a default value, so even when thesecondary_range_blocks
field is set, the conditional expressions in both dynamic blocks returntrue
and Terraform throws an error because there should be only oneip_allocation_policy
block:Sadly, I don't have the time to fix this right now, so am just recording it here for future reference. From the top of my head, the way I would try to fix this is to make the conditional expressions in both dynamic blocks depend on
secondary_range_blocks
only, in an inverse way:secondary_range_blocks
isnull
, we use names:secondary_range_blocks
is notnull
, we use blocks:secondary_range_names
, so the second conditional must return false.I hope this is going to make sense when I'm going to read it later 😆
The text was updated successfully, but these errors were encountered: