Skip to content

Commit

Permalink
Add ShowOption for configuring JSON decoding (#427)
Browse files Browse the repository at this point in the history
* Adding ShowOption for JSON handling (#426)

* Temporarily pointing at terraform-json PR for dependent changes (#426)

* Ignoring fields that differ between TF versions (#426)

* Rename structs and func (#426)

* Removing redundant struct (#426)

* Update tfexec/options.go

Co-authored-by: kmoe <[email protected]>

* Updating to use renamed struct (#426)

* Bumping terraform-json to v0.19.0 (#426)

---------

Co-authored-by: kmoe <[email protected]>
  • Loading branch information
bendbennett and kmoe authored Dec 20, 2023
1 parent ba030d6 commit 7975ca6
Show file tree
Hide file tree
Showing 6 changed files with 484 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/hc-install v0.6.2
github.com/hashicorp/terraform-json v0.18.0
github.com/hashicorp/terraform-json v0.19.0
github.com/zclconf/go-cty v1.14.1
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mO
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/hc-install v0.6.2 h1:V1k+Vraqz4olgZ9UzKiAcbman9i9scg9GgSt/U3mw/M=
github.com/hashicorp/hc-install v0.6.2/go.mod h1:2JBpd+NCFKiHiu/yYCGaPyPHhZLxXTpz8oreHa/a3Ps=
github.com/hashicorp/terraform-json v0.18.0 h1:pCjgJEqqDESv4y0Tzdqfxr/edOIGkjs8keY42xfNBwU=
github.com/hashicorp/terraform-json v0.18.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk=
github.com/hashicorp/terraform-json v0.19.0 h1:e9DBKC5sxDfiJT7Zoi+yRIwqLVtFur/fwK/FuE6AWsA=
github.com/hashicorp/terraform-json v0.19.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
Expand Down
6 changes: 4 additions & 2 deletions tfexec/internal/e2etest/cmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ func diffState(expected *tfjson.State, actual *tfjson.State) string {

// diffPlan returns a human-readable report of the differences between two
// plan values. It returns an empty string if the two values are equal.
func diffPlan(expected *tfjson.Plan, actual *tfjson.Plan) string {
return cmp.Diff(expected, actual, cmpopts.IgnoreFields(tfjson.Plan{}, "TerraformVersion"))
func diffPlan(expected *tfjson.Plan, actual *tfjson.Plan, opts ...cmp.Option) string {
opts = append(opts, cmpopts.IgnoreFields(tfjson.Plan{}, "TerraformVersion", "useJSONNumber"))

return cmp.Diff(expected, actual, opts...)
}

// diffSchema returns a human-readable report of the differences between two
Expand Down
Loading

0 comments on commit 7975ca6

Please sign in to comment.