-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Return error when the template's single interpolation results in null value #36658
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
Conversation
| @@ -0,0 +1,5 @@ | |||
| kind: BUG FIXES | |||
| body: Return error when the template's single interpolation results in null value | |||
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.
Could you please update the change file to mention the templatestring function?
Changelog WarningCurrently this PR would target a v1.11 release. Please add a changelog entry for in the .changes/v1.11 folder, or discuss which release you'd like to target with your reviewer. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label. |
|
Heads up, the changelog for this change has ended up in the wrong folder and wrong branch. Since it was backported to 1.11, there should only be a changelog file on the v1.11 branch in the .changes/1.11 directory. None on main |
|
Thanks @dbanck. I'll move appropriately |
* Avoid crash due to map with `null` values Follow up of hashicorp/terraform#36611 * Update Terraform compatibility guide * Return error when the template's single interpolation results in null value Follow up of hashicorp/terraform#36658 * Bump patch version
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fixes #36652
When a string interpolation contains only one expression sequence, HCL optimizes by wrapping and directly delegating evaluation to that expression. The
templatestringfunction tries to refine the expression value as non-null, and if null, this refinement leads to a panic. For compatibility reasons, HCL has to continue to support this unwrapping logic (See attempted PR), thus we will simply return an error intemplatestringwhen the single evaluated expression is nullTarget Release
1.12.x
CHANGELOG entry