Skip to content

handle empty containers in ProposedNew NestedTypes#29580

Merged
jbardin merged 2 commits intomainfrom
jbardin/proposed-new-empty-containers
Sep 15, 2021
Merged

handle empty containers in ProposedNew NestedTypes#29580
jbardin merged 2 commits intomainfrom
jbardin/proposed-new-empty-containers

Conversation

@jbardin
Copy link
Copy Markdown
Member

@jbardin jbardin commented Sep 14, 2021

Empty containers of NestedTypes were not handled in ProposedNew, causing plans to be submitted with null values where there was configuration present.

Fixes #29576

The CoerceValue code was not updated to handle NestedTypes, and while
none of the new codepaths make use of this method, there are still some
internal uses.
@jbardin jbardin added the 1.0-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Sep 14, 2021
@jbardin jbardin requested a review from a team September 14, 2021 20:41
Copy link
Copy Markdown
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

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

This makes sense to me... I guess we inherited this from the codepath which handles blocks where we needed to preserve the rigid invarants the SDK expected for those, but that sort of mangling isn't correct for attributes.

The realization that this was likely the extra processing we had to do to make blocks work then led to the question I left inline, though if the answer to that is "no" (that is, if there's a reason to reconstruct new values rather than just preserve the existing ones) then I'm happy to keep it how you wrote it, though I'd love to know more about what that reason is for my own edification! 😀

Empty containers of NestedTypes were not handled in ProposedNew, causing
plans to be submitted with null values where there was configuration
present.
@jbardin jbardin force-pushed the jbardin/proposed-new-empty-containers branch from e1c8fa7 to 331dc8b Compare September 15, 2021 12:33
@jbardin jbardin changed the base branch from jbardin/coerce-value-nested-types to main September 15, 2021 13:06
@jbardin jbardin merged commit 2afa0a5 into main Sep 15, 2021
@jbardin jbardin deleted the jbardin/proposed-new-empty-containers branch September 15, 2021 13:06
@github-actions
Copy link
Copy Markdown
Contributor

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 contributions.
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 Oct 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

1.0-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

terraform plan reports "planned for absence but config wants existence" when provider returns empty Set

2 participants