0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-29 18:21:10 +00:00

fix(firewall): prevent reordering of CIDRs in ipset resource with mixed IPv4/IPv6 (#1935)

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2025-04-28 19:12:25 -04:00 committed by GitHub
parent ebd5399e14
commit 64147cd24e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 0 deletions

View File

@ -47,6 +47,32 @@ func TestAccResourceClusterFirewall(t *testing.T) {
}),
),
}}},
{"ipset with ipV4 and ipV6 cidrs", []resource.TestStep{{
Config: te.RenderConfig(`
resource "proxmox_virtual_environment_firewall_ipset" "ipset" {
name = "test"
cidr {
name = "192.168.0.0/24"
comment = "Local IPv4"
}
cidr {
name = "2001:db8:ab21:7b00::/64"
comment = "LAN IPv6"
}
cidr {
name = "172.10.0.0/24"
comment = "ext IPv4"
}
cidr {
name = "2001:db8:5a93:1e00::/64"
comment = "ext IPv6"
}
cidr {
name = "2001:0DB8:91AA:7C30::1"
comment = "ext 2 IPv6"
}
}`),
}}},
}
for _, tt := range tests {

View File

@ -52,6 +52,7 @@ func IPSet() *schema.Resource {
DefaultFunc: func() (interface{}, error) {
return []interface{}{}, nil
},
DiffSuppressFunc: structure.SuppressIfListsOfMapsAreEqualIgnoringOrderByKey(mkIPSetCIDRName),
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
mkIPSetCIDRName: {