Skip to content

Commit 4ae54fc

Browse files
fixing custom performance pool, since totalIops will be returned by sever (#15005) (#24207)
[upstream:a941c02deef4cbe80d086539a7f4856bea4e1318] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 782b62e commit 4ae54fc

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

.changelog/15005.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 a permadiff on `total_iops` in `google_netapp_storage_pool` resource
3+
```

google/services/netapp/resource_netapp_storage_pool.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Possible values are: AUTO, MANUAL. Possible values: ["QOS_TYPE_UNSPECIFIED", "AU
151151
},
152152
"total_iops": {
153153
Type: schema.TypeString,
154+
Computed: true,
154155
Optional: true,
155156
Description: `Optional. Custom Performance Total IOPS of the pool If not provided, it will be calculated based on the totalThroughputMibps`,
156157
},

google/services/netapp/resource_netapp_storage_pool_test.go

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,3 +440,75 @@ data "google_compute_network" "default" {
440440
}
441441
`, context)
442442
}
443+
444+
func TestAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_update(t *testing.T) {
445+
context := map[string]interface{}{
446+
"network_name": acctest.BootstrapSharedServiceNetworkingConnection(t, "gcnv-network-config-3", acctest.ServiceNetworkWithParentService("netapp.servicenetworking.goog")),
447+
"random_suffix": acctest.RandString(t, 10),
448+
}
449+
450+
acctest.VcrTest(t, resource.TestCase{
451+
PreCheck: func() { acctest.AccTestPreCheck(t) },
452+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
453+
CheckDestroy: testAccCheckNetappStoragePoolDestroyProducer(t),
454+
Steps: []resource.TestStep{
455+
{
456+
Config: testAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_full(context),
457+
},
458+
{
459+
ResourceName: "google_netapp_storage_pool.test_pool",
460+
ImportState: true,
461+
ImportStateVerify: true,
462+
ImportStateVerifyIgnore: []string{"location", "name", "labels", "terraform_labels"},
463+
},
464+
{
465+
Config: testAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_update(context),
466+
},
467+
{
468+
ResourceName: "google_netapp_storage_pool.test_pool",
469+
ImportState: true,
470+
ImportStateVerify: true,
471+
ImportStateVerifyIgnore: []string{"location", "name", "labels", "terraform_labels"},
472+
},
473+
},
474+
})
475+
}
476+
477+
func testAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_full(context map[string]interface{}) string {
478+
return acctest.Nprintf(`
479+
resource "google_netapp_storage_pool" "test_pool" {
480+
name = "tf-test-pool%{random_suffix}"
481+
location = "us-east4-a"
482+
service_level = "FLEX"
483+
capacity_gib = "2048"
484+
network = data.google_compute_network.default.id
485+
description = "this is a test description"
486+
custom_performance_enabled = true
487+
total_throughput_mibps = "200"
488+
}
489+
490+
data "google_compute_network" "default" {
491+
name = "%{network_name}"
492+
}
493+
`, context)
494+
}
495+
496+
func testAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_update(context map[string]interface{}) string {
497+
return acctest.Nprintf(`
498+
resource "google_netapp_storage_pool" "test_pool" {
499+
name = "tf-test-pool%{random_suffix}"
500+
location = "us-east4-a"
501+
service_level = "FLEX"
502+
capacity_gib = "2048"
503+
network = data.google_compute_network.default.id
504+
description = "this is updated test description"
505+
custom_performance_enabled = true
506+
total_throughput_mibps = "200"
507+
total_iops = "3500"
508+
}
509+
510+
data "google_compute_network" "default" {
511+
name = "%{network_name}"
512+
}
513+
`, context)
514+
}

0 commit comments

Comments
 (0)