Skip to content
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

hclsyntax: Fix panic for marked template loops #437

Merged
merged 2 commits into from
Jan 5, 2021

Conversation

alisdair
Copy link
Member

Fixes this downstream Terraform bug. I couldn't find any other instances of calling ElementIterator on a possibly-marked collection (except in splat expressions, which is fixed by #436).

@alisdair alisdair requested a review from a team December 18, 2020 18:52
Copy link
Contributor

@pselle pselle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 with optional test coverage addition

Variables: map[string]cty.Value{
"secrets": cty.ListVal([]cty.Value{
cty.StringVal("foo"),
cty.StringVal("bar"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question about test coverage addition where a member of the collection is marked, but the collection itself is not initially marked.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent catch! I added a test, found another panic, and fixed the panic. Thank you!

If individual template expressions in a loop have marks, merge those
marks into the final result when joining.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants