-
Notifications
You must be signed in to change notification settings - Fork 562
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
fix: use null as default for lookup #332
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
When can I expect a review? |
/gcbrun |
1 similar comment
/gcbrun |
Is there anything else I can provide in order to have this PR reviewed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I realized it might be user error, here's a minimal example that reproduces the error that I get:
and without the ternary operator
it works fine. I'm aware of conversions made by conditional expressions, but I don't know Terraform well enough to understand why it would complain here. Is that intended behavior? In any case, I leave it up to the maintainers to judge if this PR is valuable still 😁 Edit: This also works
In any case, |
Thanks @cyuanli - What is the intention of If we have a syntactically correct reproducible test case this resolves, I'm absolutely happy to merge it. |
I added
I tried to keep it minimal there, in reality it's more something like
|
For reference, created an issue for terraform here: hashicorp/terraform#35662 Very curious to find out if that is intended behavior 😄 |
hashicorp/terraform#35662 (comment) As explained here, the empty map shouldn't be used in these cases. I replaced them with |
/gcbrun |
Hi @cyuanli! Great to have test coverage, but can we set
|
Ah of course, set it to |
/gcbrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @cyuanli!
Currently, any
retention_policy
throws this error:This fixes the default for the lookup, similar to #318. Given that this seems to be a recurring bug, it might be worth looking into
terraform-google-cloud-storage/main.tf
Line 122 in 07e3a4e
terraform-google-cloud-storage/main.tf
Line 152 in 07e3a4e