Open VenelinMartinov opened 2 months ago
The issue here is not with detailed diff but with the value saved in state. We return the correct thing in detailed diff:
detailedDiff=map[string]*pulumirpc.PropertyDiff{
"listBlocks": &pulumirpc.PropertyDiff{
state: impl.MessageState{},
sizeCache: 0,
unknownFields: nil,
Kind: 2,
InputDiff: false,
},
}
But in the state we have:
props=resource.PropertyMap{
"id": {
V: "newid",
},
"listBlocks": {
V: []resource.PropertyValue{
{
V: resource.PropertyMap{
"prop": {},
},
},
},
},
"listProps": {},
"mapProp": {},
"maxItemsOneBlock": {},
"setBlocks": {},
"setProps": {},
"stringProp": {},
}
which gets display in an unexpected way by the detailed diff.
We should either remove the nil prop from the state or fix the detailed diff display logic here in the engine.
What happened?
The detailed diff displays a diff on a nested property which was never specified when the containing block is removed:
Example
https://github.com/pulumi/pulumi-terraform-bridge/pull/2398
maxItemsOne block removed empty
Output of
pulumi about
.
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).