Ephemeral write only attributes (#3171)

Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
Andrei Ciobanu
2025-08-25 13:57:11 +03:00
committed by Christian Mesh
parent cbe16d3a5d
commit 7f76707dd0
29 changed files with 2389 additions and 89 deletions

View File

@@ -8,6 +8,7 @@ package differ
import (
"github.com/opentofu/opentofu/internal/command/jsonformat/computed"
"github.com/opentofu/opentofu/internal/command/jsonformat/structured"
"github.com/opentofu/opentofu/internal/plans"
)
// asDiff is a helper function to abstract away some simple and common
@@ -15,3 +16,10 @@ import (
func asDiff(change structured.Change, renderer computed.DiffRenderer) computed.Diff {
return computed.NewDiff(renderer, change.CalculateAction(), change.ReplacePaths.Matches())
}
// asDiffWithInheritedAction is a specific implementation of asDiff that gets also a parentAction plans.Action.
// This is used when the given change is known to always generate a NoOp diff, but it still should be shown
// in the printed diff.
func asDiffWithInheritedAction(change structured.Change, parentAction plans.Action, renderer computed.DiffRenderer) computed.Diff {
return computed.NewDiff(renderer, parentAction, change.ReplacePaths.Matches())
}