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 #33813

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

alisdair
Copy link
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.

Fixes #33770

Target Release

1.3.10

Draft CHANGELOG entry

BUG FIXES

  • terraform_remote_state: fix incompatibility with states produced by Terraform 1.5 or later which include check block results.

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 requested a review from a team September 6, 2023 14:27
@alisdair alisdair self-assigned this Sep 6, 2023
@alisdair alisdair merged commit 07b64e2 into v1.3 Sep 13, 2023
@github-actions
Copy link
Contributor

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

Copy link
Contributor

github-actions bot commented Dec 9, 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 Dec 9, 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.

2 participants