You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix for TypeSet applying with unexpected empty element (#2)
hashicorp/terraform-plugin-sdk#895
When calculating a diff, sets are added as delete of all old attributes
and a create of all new attributes. When DiffSuppressFunc is used, the
delete attribute drops the `NewRemoved` field, which results in sending
a diff that ends up creating a new empty set element.
Without the fix, the test fails:
```
=== RUN TestSchemaMap_Diff/30-Set_with_DiffSuppressFunc
schema_test.go:3188: expected:
*terraform.InstanceDiff{ [...]"rule.80.duration":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:false, NewRemoved:true, [...]
got:
*terraform.InstanceDiff{ [...]"rule.80.duration":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:false, [...] NewRemoved:false, [...]
```
Previously, `NewRemoved` was set to false for the sustain field even though it belonged to an element being removed.
0 commit comments