Skip to content

statefile: Ignore unknown check results on decode#33818

Merged
alisdair merged 1 commit intov1.5from
alisdair/check-results-state-compatibility-1.5
Sep 6, 2023
Merged

statefile: Ignore unknown check results on decode#33818
alisdair merged 1 commit intov1.5from
alisdair/check-results-state-compatibility-1.5

Conversation

@alisdair
Copy link
Copy Markdown
Contributor

@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
@github-actions
Copy link
Copy Markdown
Contributor

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.

@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 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.

1 participant