-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalize block values before passing to TF provider (#1971)
part of #1785 This change adds a normalisation step for collections when recovering cty values to pass to terraform. This ensures we represent them similarly to terraform. In practice this means that all block collections need to be passed to TF providers as an empty collection instead of nil. This should get rid of quite a few subtle discrepancies in the data we pass to the TF provider code. These sometimes result in panics since we pass unexpected nils. This gets rid of all known input discrepancies discovered so far through cross-testing. The full rules for what is a block are [here](https://github.com/hashicorp/terraform-plugin-sdk/blob/1f499688ebd9420768f501d4ed622a51b2135ced/helper/schema/core_schema.go#L60). It is essentially properties with schema: typeList or typeSet with a Resource Elem. fixes #1970 fixes #1915 fixes #1964 fixes #1767 fixes #1762 TODO: [DONE] remove the MaxItemsOne default hacks introduced in #1725 (opened #2049) --------- Co-authored-by: Anton Tayanovskyy <[email protected]> Co-authored-by: Ian Wahbe <[email protected]>
- Loading branch information
1 parent
a9d0c7c
commit 98f15a1
Showing
5 changed files
with
352 additions
and
24 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
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
Oops, something went wrong.