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

Sanitize var code #11566

Merged
merged 11 commits into from
Feb 14, 2022
Merged

Sanitize var code #11566

merged 11 commits into from
Feb 14, 2022

Conversation

azr
Copy link
Contributor

@azr azr commented Feb 14, 2022

This fixes #11554 and a panic I discovered while testing things + fixes some docs

Related: #11534

This also fixes #11551

  • fix 11554
  • test 11554
  • fix panic
  • test panic
  • fix 11551
  • test 11551
  • fix docs

This should be the default, and avoids a panic. This type can represent situations where a type is not yet known. Its meaning is undefined in cty.
remove untrue docs
@azr azr requested a review from a team as a code owner February 14, 2022 13:18
Comment on lines +2 to +3
variable "vms_to_build" {
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The panic was here, because no type was given to this variable, and while trying to loop (for) on it, the HCL library would panic because the var has no type.


source "file" "chocolate" {
content = "hello"
target = "${local.dynamic_slice.amgroup}.txt"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the test we check that there is a hey.txt file.

@azr azr force-pushed the azr/simplify_recursive_var_code branch from e69e839 to a007161 Compare February 14, 2022 15:14
@azr azr changed the title Simplify recursive var code Sanitize var code Feb 14, 2022
Update inspect_test.go
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

Nicely done. LGTM!

command/build_test.go Outdated Show resolved Hide resolved
@nywilken nywilken merged commit e03ad29 into master Feb 14, 2022
@nywilken nywilken deleted the azr/simplify_recursive_var_code branch February 14, 2022 16:00
@github-actions
Copy link

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 issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v1.7.10 broke local references Can't merge maps with heterogeneous values and use types any or map(any)
2 participants