Files
opentf/internal/command/jsonformat/differ/output.go
Liam Cervante 99823e4a15 Structured Plan Renderer: Fix minor bugs causing diffs in the equivalence tests. (#32519)
* remove attributes that do not match the relevant attributes filter

* fix formatting

* fix renderer function, don't drop irrelevant attributes just mark them as no-ops

* fix imports

* fix bugs in the renderer exposed by the equivalence tests

* imports

* gofmt
2023-01-17 09:31:29 +01:00

22 lines
644 B
Go

package differ
import (
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/command/jsonformat/computed"
"github.com/hashicorp/terraform/internal/command/jsonformat/computed/renderers"
)
func (change Change) ComputeDiffForOutput() computed.Diff {
if sensitive, ok := change.checkForSensitiveType(cty.DynamicPseudoType); ok {
return sensitive
}
if unknown, ok := change.checkForUnknownType(cty.DynamicPseudoType); ok {
return unknown
}
jsonOpts := renderers.RendererJsonOpts()
return jsonOpts.Transform(change.Before, change.After, change.BeforeExplicit, change.AfterExplicit, change.RelevantAttributes)
}