Skip to content

Commit

Permalink
also check basic type
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht committed Oct 25, 2023
1 parent a37b203 commit c198db3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/reflect_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ func StructToData(result any, s map[string]*schema.Schema, d *schema.ResourceDat
// If the ForceSendFields field is present, and the field is not in the list, and its value
// is the zero value, then the server did not respond with this field, so it should not be set
// in the resource data.
if hasForceSendFields && !slices.Contains(forceSendFields, fieldPath) && valueField.IsZero() {
if hasForceSendFields && isBasicType(fieldSchema.Type) && !slices.Contains(forceSendFields, fieldPath) && valueField.IsZero() {
log.Printf("[TRACE] Skipping field %s because it is not in ForceSendFields and is zero value", fieldPath)
return nil
}
Expand Down

0 comments on commit c198db3

Please sign in to comment.