Skip to content

Commit a941c02

Browse files
authored
fixing custom performance pool, since totalIops will be returned by sever (#15005)
1 parent d6166b5 commit a941c02

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

mmv1/products/netapp/StoragePool.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ properties:
194194
type: String
195195
description: |
196196
Optional. Custom Performance Total IOPS of the pool If not provided, it will be calculated based on the totalThroughputMibps
197+
default_from_api: true
197198
- name: 'hotTierSizeGib'
198199
type: String
199200
description: |

mmv1/third_party/terraform/services/netapp/resource_netapp_storage_pool_test.go.tmpl

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,3 +567,75 @@ data "google_compute_network" "default" {
567567
}
568568
`, context)
569569
}
570+
571+
func TestAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_update(t *testing.T) {
572+
context := map[string]interface{}{
573+
"network_name": acctest.BootstrapSharedServiceNetworkingConnection(t, "gcnv-network-config-3", acctest.ServiceNetworkWithParentService("netapp.servicenetworking.goog")),
574+
"random_suffix": acctest.RandString(t, 10),
575+
}
576+
577+
acctest.VcrTest(t, resource.TestCase{
578+
PreCheck: func() { acctest.AccTestPreCheck(t) },
579+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
580+
CheckDestroy: testAccCheckNetappStoragePoolDestroyProducer(t),
581+
Steps: []resource.TestStep{
582+
{
583+
Config: testAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_full(context),
584+
},
585+
{
586+
ResourceName: "google_netapp_storage_pool.test_pool",
587+
ImportState: true,
588+
ImportStateVerify: true,
589+
ImportStateVerifyIgnore: []string{"location", "name", "labels", "terraform_labels"},
590+
},
591+
{
592+
Config: testAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_update(context),
593+
},
594+
{
595+
ResourceName: "google_netapp_storage_pool.test_pool",
596+
ImportState: true,
597+
ImportStateVerify: true,
598+
ImportStateVerifyIgnore: []string{"location", "name", "labels", "terraform_labels"},
599+
},
600+
},
601+
})
602+
}
603+
604+
func testAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_full(context map[string]interface{}) string {
605+
return acctest.Nprintf(`
606+
resource "google_netapp_storage_pool" "test_pool" {
607+
name = "tf-test-pool%{random_suffix}"
608+
location = "us-east4-a"
609+
service_level = "FLEX"
610+
capacity_gib = "2048"
611+
network = data.google_compute_network.default.id
612+
description = "this is a test description"
613+
custom_performance_enabled = true
614+
total_throughput_mibps = "200"
615+
}
616+
617+
data "google_compute_network" "default" {
618+
name = "%{network_name}"
619+
}
620+
`, context)
621+
}
622+
623+
func testAccNetappStoragePool_customPerformanceEnabledStoragePoolCreateExample_update(context map[string]interface{}) string {
624+
return acctest.Nprintf(`
625+
resource "google_netapp_storage_pool" "test_pool" {
626+
name = "tf-test-pool%{random_suffix}"
627+
location = "us-east4-a"
628+
service_level = "FLEX"
629+
capacity_gib = "2048"
630+
network = data.google_compute_network.default.id
631+
description = "this is updated test description"
632+
custom_performance_enabled = true
633+
total_throughput_mibps = "200"
634+
total_iops = "3500"
635+
}
636+
637+
data "google_compute_network" "default" {
638+
name = "%{network_name}"
639+
}
640+
`, context)
641+
}

0 commit comments

Comments
 (0)