Skip to content

Commit

Permalink
Merge pull request #33818 from hashicorp/alisdair/check-results-state…
Browse files Browse the repository at this point in the history
…-compatibility-1.5

statefile: Ignore unknown check results on decode
  • Loading branch information
alisdair committed Sep 6, 2023
2 parents cec3d4c + f2f6a5c commit 7499c6b
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 7499c6b

Please sign in to comment.