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

Amend Plan Resource Change To Allow For Optional Blocks #552

Merged
merged 3 commits into from Nov 28, 2022

Conversation

bendbennett
Copy link
Contributor

@bendbennett bendbennett commented Nov 28, 2022

…ional blocks to be present within configuration (#551)
@bendbennett bendbennett requested a review from a team as a code owner November 28, 2022 12:08
@bflad bflad self-assigned this Nov 28, 2022
@bflad bflad added the bug Something isn't working label Nov 28, 2022
Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Other than the one test fix and missing changelog, looks good to me 🚀

},
PriorState: &tfsdk.State{
Raw: tftypes.NewValue(testSchemaBlockType, map[string]tftypes.Value{
"test_required": tftypes.NewValue(tftypes.String, "test-new-value"),
Copy link
Member

Choose a reason for hiding this comment

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

To trigger this new unit test to fail without the fix and therefore verify the fix, there needs to be a difference between the prior state and proposed new state to trigger the call to MarkComputedNilsAsUnknown. Adjusting this line should do the trick.

Suggested change
"test_required": tftypes.NewValue(tftypes.String, "test-new-value"),
"test_required": tftypes.NewValue(tftypes.String, "test-value"),

The reason this issue occurs upstream is mainly because during resource creation, the prior state is null, but the proposed new state contains blocks.

@bflad bflad added this to the v0.17.0 milestone Nov 28, 2022
@bflad bflad merged commit 486e611 into main Nov 28, 2022
@bflad bflad deleted the bendbennett/issues-551 branch November 28, 2022 18:43
bflad pushed a commit that referenced this pull request Nov 28, 2022
additional test coverage for the MarkComputedNilsAsUnknown changes
added in #552
@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 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 Dec 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amend Plan Resource Change To Allow For Optional Blocks timeouts.Block causes error in modify plan set
2 participants