Skip to content

Commit 470029a

Browse files
Revert "[BLOCK] Add storage pool type field" (#15406) (#10891)
[upstream:b661adacdaa34f49efebe4566fd564a9556da0b1] Signed-off-by: Modular Magician <[email protected]>
1 parent 4d503ca commit 470029a

File tree

5 files changed

+5
-88
lines changed

5 files changed

+5
-88
lines changed

.changelog/15406.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: revert field `type` in `google_netapp_storage_pool` resource
3+
```

google-beta/services/netapp/resource_netapp_storage_pool.go

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func ResourceNetappStoragePool() *schema.Resource {
4949
Timeouts: &schema.ResourceTimeout{
5050
Create: schema.DefaultTimeout(45 * time.Minute),
5151
Update: schema.DefaultTimeout(20 * time.Minute),
52-
Delete: schema.DefaultTimeout(45 * time.Minute),
52+
Delete: schema.DefaultTimeout(20 * time.Minute),
5353
},
5454

5555
CustomizeDiff: customdiff.All(
@@ -103,7 +103,6 @@ Auto-tiering can be enabled after storage pool creation but it can't be disabled
103103
},
104104
"custom_performance_enabled": {
105105
Type: schema.TypeBool,
106-
Computed: true,
107106
Optional: true,
108107
ForceNew: true,
109108
Description: `Optional. True if using Independent Scaling of capacity and performance (Hyperdisk). Default is false.`,
@@ -175,16 +174,6 @@ Possible values are: AUTO, MANUAL. Possible values: ["QOS_TYPE_UNSPECIFIED", "AU
175174
Optional: true,
176175
Description: `Optional. Custom Performance Total Throughput of the pool (in MiB/s).`,
177176
},
178-
"type": {
179-
Type: schema.TypeString,
180-
Computed: true,
181-
Optional: true,
182-
ForceNew: true,
183-
ValidateFunc: verify.ValidateEnum([]string{"STORAGE_POOL_TYPE_UNSPECIFIED", "FILE", "UNIFIED", ""}),
184-
Description: `Type of the storage pool.
185-
This field is used to control whether the pool supports FILE based volumes only or UNIFIED (both FILE and BLOCK) volumes.
186-
If not specified during creation, it defaults to FILE. Possible values: ["STORAGE_POOL_TYPE_UNSPECIFIED", "FILE", "UNIFIED"]`,
187-
},
188177
"zone": {
189178
Type: schema.TypeString,
190179
Computed: true,
@@ -351,12 +340,6 @@ func resourceNetappStoragePoolCreate(d *schema.ResourceData, meta interface{}) e
351340
} else if v, ok := d.GetOkExists("qos_type"); !tpgresource.IsEmptyValue(reflect.ValueOf(qosTypeProp)) && (ok || !reflect.DeepEqual(v, qosTypeProp)) {
352341
obj["qosType"] = qosTypeProp
353342
}
354-
typeProp, err := expandNetappStoragePoolType(d.Get("type"), d, config)
355-
if err != nil {
356-
return err
357-
} else if v, ok := d.GetOkExists("type"); !tpgresource.IsEmptyValue(reflect.ValueOf(typeProp)) && (ok || !reflect.DeepEqual(v, typeProp)) {
358-
obj["type"] = typeProp
359-
}
360343
effectiveLabelsProp, err := expandNetappStoragePoolEffectiveLabels(d.Get("effective_labels"), d, config)
361344
if err != nil {
362345
return err
@@ -528,9 +511,6 @@ func resourceNetappStoragePoolRead(d *schema.ResourceData, meta interface{}) err
528511
if err := d.Set("hot_tier_size_used_gib", flattenNetappStoragePoolHotTierSizeUsedGib(res["hotTierSizeUsedGib"], d, config)); err != nil {
529512
return fmt.Errorf("Error reading StoragePool: %s", err)
530513
}
531-
if err := d.Set("type", flattenNetappStoragePoolType(res["type"], d, config)); err != nil {
532-
return fmt.Errorf("Error reading StoragePool: %s", err)
533-
}
534514
if err := d.Set("terraform_labels", flattenNetappStoragePoolTerraformLabels(res["labels"], d, config)); err != nil {
535515
return fmt.Errorf("Error reading StoragePool: %s", err)
536516
}
@@ -982,10 +962,6 @@ func flattenNetappStoragePoolHotTierSizeUsedGib(v interface{}, d *schema.Resourc
982962
return v
983963
}
984964

985-
func flattenNetappStoragePoolType(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
986-
return v
987-
}
988-
989965
func flattenNetappStoragePoolTerraformLabels(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
990966
if v == nil {
991967
return v
@@ -1069,10 +1045,6 @@ func expandNetappStoragePoolQosType(v interface{}, d tpgresource.TerraformResour
10691045
return v, nil
10701046
}
10711047

1072-
func expandNetappStoragePoolType(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
1073-
return v, nil
1074-
}
1075-
10761048
func expandNetappStoragePoolEffectiveLabels(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]string, error) {
10771049
if v == nil {
10781050
return map[string]string{}, nil

google-beta/services/netapp/resource_netapp_storage_pool_generated_meta.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ fields:
3333
provider_only: true
3434
- api_field: 'totalIops'
3535
- api_field: 'totalThroughputMibps'
36-
- api_field: 'type'
3736
- api_field: 'volumeCapacityGib'
3837
- api_field: 'volumeCount'
3938
- api_field: 'zone'

google-beta/services/netapp/resource_netapp_storage_pool_test.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -743,53 +743,3 @@ data "google_compute_network" "default" {
743743
}
744744
`, context)
745745
}
746-
747-
func TestAccNetappStoragePool_unifiedStoragePoolCreate(t *testing.T) {
748-
t.Parallel()
749-
750-
context := map[string]interface{}{
751-
"network_name": acctest.BootstrapSharedServiceNetworkingConnection(t, "gcnv-network-config-3", acctest.ServiceNetworkWithParentService("netapp.servicenetworking.goog")),
752-
"random_suffix": acctest.RandString(t, 10),
753-
}
754-
755-
acctest.VcrTest(t, resource.TestCase{
756-
PreCheck: func() { acctest.AccTestPreCheck(t) },
757-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
758-
Steps: []resource.TestStep{
759-
{
760-
Config: testAccNetappStoragePool_unifiedStoragePoolCreate(context),
761-
},
762-
{
763-
ResourceName: "google_netapp_storage_pool.test_pool",
764-
ImportState: true,
765-
ImportStateVerify: true,
766-
ImportStateVerifyIgnore: []string{"location", "name", "labels", "terraform_labels"},
767-
},
768-
},
769-
})
770-
}
771-
772-
func testAccNetappStoragePool_unifiedStoragePoolCreate(context map[string]interface{}) string {
773-
return acctest.Nprintf(`
774-
775-
data "google_compute_network" "default" {
776-
provider = google-beta
777-
name = "%{network_name}"
778-
}
779-
780-
resource "google_netapp_storage_pool" "test_pool" {
781-
provider = google-beta
782-
name = "tf-test-pool%{random_suffix}"
783-
location = "us-central1-a"
784-
service_level = "FLEX"
785-
type = "UNIFIED"
786-
capacity_gib = "2048"
787-
network = data.google_compute_network.default.id
788-
description = "this is a test description"
789-
labels = {
790-
key = "test"
791-
value = "pool"
792-
}
793-
}
794-
`, context)
795-
}

website/docs/r/netapp_storage_pool.html.markdown

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,6 @@ The following arguments are supported:
197197
Possible values are: AUTO, MANUAL.
198198
Possible values are: `QOS_TYPE_UNSPECIFIED`, `AUTO`, `MANUAL`.
199199

200-
* `type` -
201-
(Optional)
202-
Type of the storage pool.
203-
This field is used to control whether the pool supports FILE based volumes only or UNIFIED (both FILE and BLOCK) volumes.
204-
If not specified during creation, it defaults to FILE.
205-
Possible values are: `STORAGE_POOL_TYPE_UNSPECIFIED`, `FILE`, `UNIFIED`.
206-
207200
* `project` - (Optional) The ID of the project in which the resource belongs.
208201
If it is not provided, the provider project is used.
209202

@@ -248,7 +241,7 @@ This resource provides the following
248241

249242
- `create` - Default is 45 minutes.
250243
- `update` - Default is 20 minutes.
251-
- `delete` - Default is 45 minutes.
244+
- `delete` - Default is 20 minutes.
252245

253246
## Import
254247

0 commit comments

Comments
 (0)