-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't use existing context when evaluating resources, data or pr…
…ovider blocks The SetByDot function handles the merging anyway, so we don't need to pull out the existing values. I've left the old functionality in the `evaluateResource` and `evaluatorProvider` functions because the legacy evaluator needs it. This also fixes an issue where the data blocks were using `e.ctx.Get(b.TypeLabel())` which was getting the wrong context. The correct functionality would have been to use `e.ctx.Get("data")`. Otherwise, this caused issues where the type of a data block matched the name of a resource, e.g. `data.aws_lb.anything` and `aws_lb.aws_lb`. In this case it would pull the context of the resource, which could cause a panic if the resource had been expanded, because it would be an array instead of the expected map.
- Loading branch information
Showing
3 changed files
with
7 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters