Skip to content

Commit ac68af0

Browse files
marked largeCapacity as immutable (#14841) (#24004)
[upstream:485317a6cf2ee43ad4beb41ee5f0729538d91ddf] Signed-off-by: Modular Magician <[email protected]>
1 parent 3631fbe commit ac68af0

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

.changelog/14841.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
netapp: fixed bug where `google_netapp_volume.large_capacity` was not properly marked as immutable, causing updates to fail (and making it impossible to change the field value after creation)
3+
```

google/services/netapp/resource_netapp_volume.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ Please refer to the field 'effective_labels' for all of the labels present on th
277277
"large_capacity": {
278278
Type: schema.TypeBool,
279279
Optional: true,
280+
ForceNew: true,
280281
Description: `Optional. Flag indicating if the volume will be a large capacity volume or a regular volume.`,
281282
},
282283
"multiple_endpoints": {
@@ -1073,12 +1074,6 @@ func resourceNetappVolumeUpdate(d *schema.ResourceData, meta interface{}) error
10731074
} else if v, ok := d.GetOkExists("backup_config"); !tpgresource.IsEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, backupConfigProp)) {
10741075
obj["backupConfig"] = backupConfigProp
10751076
}
1076-
largeCapacityProp, err := expandNetappVolumeLargeCapacity(d.Get("large_capacity"), d, config)
1077-
if err != nil {
1078-
return err
1079-
} else if v, ok := d.GetOkExists("large_capacity"); !tpgresource.IsEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, largeCapacityProp)) {
1080-
obj["largeCapacity"] = largeCapacityProp
1081-
}
10821077
multipleEndpointsProp, err := expandNetappVolumeMultipleEndpoints(d.Get("multiple_endpoints"), d, config)
10831078
if err != nil {
10841079
return err
@@ -1155,10 +1150,6 @@ func resourceNetappVolumeUpdate(d *schema.ResourceData, meta interface{}) error
11551150
"backup_config.scheduled_backup_enabled")
11561151
}
11571152

1158-
if d.HasChange("large_capacity") {
1159-
updateMask = append(updateMask, "largeCapacity")
1160-
}
1161-
11621153
if d.HasChange("multiple_endpoints") {
11631154
updateMask = append(updateMask, "multipleEndpoints")
11641155
}

0 commit comments

Comments
 (0)