Return null
instead of an empty tftypes.List
when the list is empty
#368
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Empty lists returned by the provider were causing errors on any subsequent state refresh. The state stored a
null
value, whereas the generated plan would return an emptytftypes.List
. This would cause Terraform to fail with an error likeThis PR short-circuits the empty list case to return a
null
value of the list type instead of an empty list. This allows Terraform to continue and encounter behaviour such as seen in #301, where default values are not handled as expected because fields that should have default values or be computed are not marked as such in the Cloud Control schemas.Terraform configuration
Before the update, running
terraform apply
and thenterraform plan
results in the error above.After the update, the
terraform plan
succeeds, but shows the following diffNote that a second
terraform apply
still results in the error as reported in #301.Closes #342
Closes #351
Closes #324