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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/states/statefile/version4.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,11 @@ func decodeCheckResultsV4(in []checkResultsV4) (*states.CheckResults, tfdiags.Di
for _, aggrIn := range in {
objectKind := decodeCheckableObjectKindV4(aggrIn.ObjectKind)
if objectKind == addrs.CheckableKindInvalid {
diags = diags.Append(fmt.Errorf("unsupported checkable object kind %q", aggrIn.ObjectKind))
// We cannot decode a future unknown check result kind, but
// for forwards compatibility we need not treat this as an
// error. Eliding unknown check results will not result in
// significant data loss and allows us to maintain state file
// interoperability in the 1.x series.
continue
}

Expand Down