mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 02:31: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:
parent
ebd5399e14
commit
64147cd24e
@ -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 {
|
for _, tt := range tests {
|
||||||
|
@ -52,6 +52,7 @@ func IPSet() *schema.Resource {
|
|||||||
DefaultFunc: func() (interface{}, error) {
|
DefaultFunc: func() (interface{}, error) {
|
||||||
return []interface{}{}, nil
|
return []interface{}{}, nil
|
||||||
},
|
},
|
||||||
|
DiffSuppressFunc: structure.SuppressIfListsOfMapsAreEqualIgnoringOrderByKey(mkIPSetCIDRName),
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
mkIPSetCIDRName: {
|
mkIPSetCIDRName: {
|
||||||
|
Loading…
Reference in New Issue
Block a user