From 81f7e1256899c9bc8af2af22a89e1380248aeb3a Mon Sep 17 00:00:00 2001 From: "PC-2NR0VQ3\\wai.wong" Date: Tue, 26 Nov 2024 11:44:19 +0000 Subject: [PATCH] fix: if allow all ip ranges, force description to be empty for consistency --- pkg/provider/resource_pgd.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/provider/resource_pgd.go b/pkg/provider/resource_pgd.go index cc1792c7..a100af0a 100644 --- a/pkg/provider/resource_pgd.go +++ b/pkg/provider/resource_pgd.go @@ -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) } }