Skip to content

Commit

Permalink
Merge pull request #1382 from vmware/fix-subnet-dhcp-relay
Browse files Browse the repository at this point in the history
Fix subnet dhcp relay
  • Loading branch information
annakhm authored Sep 25, 2024
2 parents 31c2c97 + cde7464 commit b4f757e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nsxt/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ func SchemaToStruct(elem reflect.Value, d *schema.ResourceData, metadata map[str
exists := false
if len(parent) > 0 && parentMap[key] != nil {
value = parentMap[key].(string)
exists = true
// For nested maps, value is initialized to zero string even if not
// specified by user explicitly
if len(value) > 0 {
exists = true
}
} else {
var v interface{}
v, exists = d.GetOk(key)
Expand Down
1 change: 1 addition & 0 deletions nsxt/resource_nsxt_vpc_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ var vpcSubnetSchema = map[string]*metadata.ExtendedSchema{
Metadata: metadata.Metadata{
SchemaType: "string",
SdkFieldName: "DhcpRelayConfigPath",
OmitIfEmpty: true,
},
},
"excluded_ips": {
Expand Down

0 comments on commit b4f757e

Please sign in to comment.