Skip to content

Commit 3246684

Browse files
committed
fix(locality): improve suppressSDKNullAssignment to handle null-to-value transitions
1 parent 03c59a6 commit 3246684

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/locality/regional/schemas.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ func Schema() *schema.Schema {
3737
}
3838

3939
func suppressSDKNullAssignment(k, old, new string, d *schema.ResourceData) bool {
40-
return new == "" && old != ""
40+
return (new == "" && old != "") || (old == "" && new != "")
4141
}

internal/locality/zonal/schemas.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ func Schema() *schema.Schema {
3737
}
3838

3939
func suppressSDKNullAssignment(k, old, new string, d *schema.ResourceData) bool {
40-
return new == "" && old != ""
40+
return (new == "" && old != "") || (old == "" && new != "")
4141
}

0 commit comments

Comments
 (0)