-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Panic using null with coalescelist inside validation condition #26988
Comments
Thank you for reporting this! I have reproduced this on 0.13.4 and 0.14-RC1 |
I have confirmed that this still happens in 0.14.2 |
Thanks for reporting this bug. For your specific use case, you might find the variable "node_pool_zones" {
type = list(string)
default = null
validation {
condition = try(length(var.node_pool_zones), 0) == try(length(toset(var.node_pool_zones)), 0)
error_message = "Duplicates zones found."
}
} As you've noticed, the binary logic operators ( |
There's a proposed fix for the panic in the upstream library here: zclconf/go-cty#81 If approved, this would be brought into Terraform in a future patch release. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Validation condition with a call to
coalescelist(null, [])
caused a panic during theplan
stage (even before acquiring a lock). Ideally validation conditions should be lazy-evaluated (see #24998), so not to require this workaround.Terraform Version
Terraform Configuration Files
Crash Output
crash log here, not trivial to get a full one from the docker run env. Click to expand.
Steps to Reproduce
References
var == null || ...
The text was updated successfully, but these errors were encountered: