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

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.

Target Release

  • 1.7.0
  • 1.6.0
  • 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 added 1.5-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged 1.6-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged labels Sep 6, 2023
@alisdair alisdair requested a review from a team September 6, 2023 14:52
@alisdair alisdair self-assigned this Sep 6, 2023
@alisdair alisdair merged commit cd99fac into main Sep 6, 2023
6 checks passed
@alisdair alisdair deleted the alisdair/check-results-state-compatibility branch September 6, 2023 16:20
@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
1.5-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged 1.6-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.

None yet

2 participants