Skip to content

Commit 1a59c18

Browse files
committed
fix: empty sets incorrectly being flagged as explicitly set
1 parent 2a1ffe3 commit 1a59c18

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

provider/resource_rediscloud_active_active_database_helpers.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ func findRegionFieldInCtyValue(ctyVal cty.Value, regionName string, fieldName st
5858
if regionVal.Type().HasAttribute(fieldName) {
5959
fieldAttr := regionVal.GetAttr(fieldName)
6060
if !fieldAttr.IsNull() {
61+
// For Set types, check if they have any elements (not just that attribute exists)
62+
if fieldAttr.Type().IsSetType() || fieldAttr.Type().IsListType() {
63+
// Empty sets/lists mean field was not explicitly set
64+
if fieldAttr.LengthInt() == 0 {
65+
return cty.NilVal, false
66+
}
67+
}
6168
return fieldAttr, true
6269
}
6370
}

0 commit comments

Comments
 (0)