Skip to content

Commit bfce62d

Browse files
authored
fix for the case when no error is thrown for 'cidr' field changes (#303)
1 parent eb7ad58 commit bfce62d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

infoblox/resource_infoblox_network_container.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ func resourceNetworkContainerUpdate(d *schema.ResourceData, m interface{}) error
198198
return fmt.Errorf("changing the value of 'network_view' field is not allowed")
199199
}
200200

201+
if d.HasChange("cidr") {
202+
return fmt.Errorf("changing the value of 'cidr' field is not allowed")
203+
}
204+
201205
if d.HasChange("parent_cidr") {
202206
return fmt.Errorf("changing the value of 'parent_cidr' field is not allowed")
203207
}

infoblox/resource_infoblox_network_container_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,20 @@ func TestAcc_resourceNetworkContainer_ipv4(t *testing.T) {
258258
}`,
259259
ExpectError: updateNotAllowedRegexp,
260260
},
261+
{
262+
Config: `
263+
resource "infoblox_ipv4_network_container" "nc_2" {
264+
network_view = "default"
265+
cidr = "25.0.10.0/24"
266+
comment = "25.0.0.0/24 network container"
267+
ext_attrs = jsonencode({
268+
"Tenant ID" = "terraform_test_tenant"
269+
Location = "Test location"
270+
Site = "Test site"
271+
})
272+
}`,
273+
ExpectError: updateNotAllowedRegexp,
274+
},
261275
{
262276
Config: `
263277
resource "infoblox_network_view" "nv1" {
@@ -463,6 +477,19 @@ func TestAcc_resourceNetworkContainer_ipv6(t *testing.T) {
463477
}`,
464478
ExpectError: updateNotAllowedRegexp,
465479
},
480+
{
481+
Config: `
482+
resource "infoblox_ipv6_network_container" "nc6_2" {
483+
network_view = "default"
484+
cidr = "fc02::/56"
485+
comment = "fc01::/56 network container"
486+
ext_attrs = jsonencode({
487+
"Tenant ID" = "terraform_test_tenant"
488+
Site = "Test site"
489+
})
490+
}`,
491+
ExpectError: updateNotAllowedRegexp,
492+
},
466493
{
467494
Config: `
468495
resource "infoblox_network_view" "nv1" {

0 commit comments

Comments
 (0)