mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-04-30 16:03:37 -04:00
Structured Plan Renderer: Remove attributes that do not match the relevant attributes filter (#32509)
* 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
This commit is contained in:
@@ -14,9 +14,13 @@ func (change Change) computeAttributeDiffAsTuple(elementTypes []cty.Type) comput
|
||||
sliceValue := change.asSlice()
|
||||
for ix, elementType := range elementTypes {
|
||||
childValue := sliceValue.getChild(ix, ix)
|
||||
if !childValue.RelevantAttributes.MatchesPartial() {
|
||||
// Mark non-relevant attributes as unchanged.
|
||||
childValue = childValue.AsNoOp()
|
||||
}
|
||||
element := childValue.computeDiffForType(elementType)
|
||||
elements = append(elements, element)
|
||||
current = collections.CompareActions(current, element.Action)
|
||||
}
|
||||
return computed.NewDiff(renderers.List(elements), current, change.ReplacePaths.ForcesReplacement())
|
||||
return computed.NewDiff(renderers.List(elements), current, change.ReplacePaths.Matches())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user