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

don't panic with a null list block value in config #32428

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Dec 21, 2022

Using ignore_changes with a list block, where the provider returned an invalid null value for that block, can result in a panic when validating the plan.

Future releases may prevent providers from storing a null block in state, however we can avoid the panic for now. Only the NestingList case needs to be handled, because legacy providers only have list and set blocks, and the set case does not use the config value.

The null case should be avoided entirely by #32424, but this is a minimal backport to patch a crash in the current minor release, and handle pre-existing state with null values.

Fixes #31536

Using ignore_changes with a list block, where the provider returned an
invalid null value for that block, can result in a panic when validating
the plan.

Future releases may prevent providers from storing a null block in
state, however we can avoid the panic for now. Only the NestingList case
needs to be handled, because legacy providers only have list and set
blocks, and the set case does not use the config value.
@jbardin jbardin added the 1.3-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Dec 21, 2022
@jbardin jbardin requested a review from a team December 21, 2022 20:01
@jbardin jbardin merged commit 5bcfd36 into main Jan 4, 2023
@jbardin jbardin deleted the jbardin/ignore-changes-panic branch January 4, 2023 14:20
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2023

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 Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.3-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 Crash
2 participants