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

statefile: Ignore unknown check results on decode #33818

Merged
merged 1 commit into from Sep 6, 2023

Conversation

alisdair
Copy link
Member

@alisdair alisdair commented Sep 6, 2023

Terraform 1.5 introduced a new check result kind, which causes a decode failure when read by Terraform 1.3 and 1.4. This means that a 1.5+ state file cannot be read by the terraform_remote_state data source in 1.3 or 1.4 series.

Aborting state decode at this point isn't strictly necessary, as we don't stand to lose important data by failing to round-trip these check results. Instead we can ignore those check results, allowing decode to elide them from the state.

This has no negative effect on the remote state data source, which only exposes root module outputs anyway.

Manual backport of #33815 because the robot failed.

Target Release

1.5.7

Draft CHANGELOG entry

BUG FIXES

  • terraform_remote_state: prevent future possible incompatibility with states which include unknown check block result kinds.

Terraform 1.5 introduced a new check result kind, which causes a decode
failure when read by Terraform 1.3 and 1.4. This means that a 1.5+ state
file cannot be read by the `terraform_remote_state` data source in 1.3
or 1.4 series.

Aborting state decode at this point isn't strictly necessary, as we
don't stand to lose important data by failing to round-trip these check
results. Instead we can ignore those check results, allowing decode to
elide them from the state.

This has no negative effect on the remote state data source, which only
exposes root module outputs anyway.
@alisdair alisdair self-assigned this Sep 6, 2023
@alisdair alisdair merged commit 7499c6b into v1.5 Sep 6, 2023
6 checks passed
@github-actions
Copy link

github-actions bot commented Sep 6, 2023

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

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 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant