Skip to content

Commit

Permalink
fix: if allow all ip ranges, force description to be empty for consis…
Browse files Browse the repository at this point in the history
…tency
  • Loading branch information
wai-wong-edb committed Nov 26, 2024
1 parent a14002f commit 81f7e12
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/provider/resource_pgd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1376,14 +1376,21 @@ func buildTFGroupsAs(ctx context.Context, diags *diag.Diagnostics, state tfsdk.S
if apiRespDgModel.AllowedIpRanges != nil && len(*apiRespDgModel.AllowedIpRanges) > 0 {
for _, v := range *apiRespDgModel.AllowedIpRanges {
v := v

description := v.Description
if v.CidrBlock == "0.0.0.0/0" {
description = ""
}

ob, diag := types.ObjectValue(allwdIpRngsElemTFType.AttrTypes, map[string]attr.Value{
"cidr_block": types.StringValue(v.CidrBlock),
"description": types.StringValue(v.Description),
"description": types.StringValue(description),
})
if diag.HasError() {
diags.Append(diag...)
return
}

allowedIpRanges = append(allowedIpRanges, ob)
}
}
Expand Down

0 comments on commit 81f7e12

Please sign in to comment.