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

Failure to unmarshall checks list with Terraform 1.6 #415

Open
Homulvas opened this issue Oct 11, 2023 · 0 comments
Open

Failure to unmarshall checks list with Terraform 1.6 #415

Homulvas opened this issue Oct 11, 2023 · 0 comments

Comments

@Homulvas
Copy link

I've updated to Terraform 1.6.1 and terraform show now produces a list of checks for one of my modules. With 1.5.7 this output was completely omitted.

This doesn't match the expectation of the State struct that Checks is a single pointer.

Running show with the current library results in:
json: cannot unmarshal array into Go struct field rawState.checks of type tfjson.CheckResultStatic

AislingHPE added a commit to AislingHPE/tofu-exec that referenced this issue May 30, 2024
There is an issue in v0.17.1 of terrraform-json where state files can't
be read when there are checks present, since checks are an arrray, and
the tool tries to marshal them to a strruct. This causes an issue with
the ShowStateFile function.

Bumping terraform-json to the latest version and running `go mod tidy`
to pull in its dependencies.

Original issue in tfexec:
hashicorp#415

Line which doesn't work currently in this repo:
https://github.com/opentofu/tofu-exec/blob/e5963f176ec5f21e5d059428189439290554c25c/tfexec/show.go#L95-L99

Patch to terraform-json:
hashicorp/terraform-json#101

Changlog from v0.17.1 to v0.22.1:
https://github.com/hashicorp/terraform-json/releases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant