Skip to content

Commit 7d1e129

Browse files
authored
added default_from_api: true for squashMode, hasRootAccess & accessType (#15160)
1 parent 98617c8 commit 7d1e129

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

mmv1/products/netapp/Volume.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ properties:
151151
type: String
152152
description: |-
153153
If enabled, the root user (UID = 0) of the specified clients doesn't get mapped to nobody (UID = 65534). This is also known as no_root_squash.
154+
default_from_api: true
154155
- name: 'accessType'
155156
type: Enum
156157
description: |
@@ -199,6 +200,7 @@ properties:
199200
- 'NO_ROOT_SQUASH'
200201
- 'ROOT_SQUASH'
201202
- 'ALL_SQUASH'
203+
default_from_api: true
202204
- name: 'anonUid'
203205
type: Integer
204206
description: |-

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

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,24 @@ func TestAccNetappVolume_volumeExportPolicyWithSquashMode(t *testing.T) {
938938
ImportStateVerify: true,
939939
ImportStateVerifyIgnore: []string{"restore_parameters", "location", "name", "deletion_policy", "labels", "terraform_labels"},
940940
},
941+
{
942+
Config: testAccNetappVolume_volumeExportPolicyWithoutSquashMode(context),
943+
},
944+
{
945+
ResourceName: "google_netapp_volume.test_volume",
946+
ImportState: true,
947+
ImportStateVerify: true,
948+
ImportStateVerifyIgnore: []string{"restore_parameters", "location", "name", "deletion_policy", "labels", "terraform_labels"},
949+
},
950+
{
951+
Config: testAccNetappVolume_volumeExportPolicyWithoutSquashModeUpdate(context),
952+
},
953+
{
954+
ResourceName: "google_netapp_volume.test_volume",
955+
ImportState: true,
956+
ImportStateVerify: true,
957+
ImportStateVerifyIgnore: []string{"restore_parameters", "location", "name", "deletion_policy", "labels", "terraform_labels"},
958+
},
941959
},
942960
})
943961
}
@@ -1222,4 +1240,80 @@ func testAccNetappVolume_volumeExportPolicyWithSquashMode_rootSquash_readNoneAcc
12221240
}
12231241
`, context)
12241242
}
1243+
1244+
func testAccNetappVolume_volumeExportPolicyWithoutSquashMode(context map[string]interface{}) string {
1245+
return acctest.Nprintf(`
1246+
resource "google_netapp_storage_pool" "default" {
1247+
provider = google-beta
1248+
name = "tf-test-pool%{random_suffix}"
1249+
location = "northamerica-northeast1"
1250+
service_level = "PREMIUM"
1251+
capacity_gib = "2048"
1252+
network = data.google_compute_network.default.id
1253+
}
1254+
resource "time_sleep" "wait_3_minutes" {
1255+
depends_on = [google_netapp_storage_pool.default]
1256+
create_duration = "3m"
1257+
}
1258+
resource "google_netapp_volume" "test_volume" {
1259+
provider = google-beta
1260+
location = "northamerica-northeast1"
1261+
name = "tf-test-test-volume%{random_suffix}"
1262+
capacity_gib = "100"
1263+
share_name = "tf-test-test-volume%{random_suffix}"
1264+
storage_pool = google_netapp_storage_pool.default.name
1265+
protocols = ["NFSV3"]
1266+
export_policy {
1267+
rules {
1268+
access_type = "READ_NONE"
1269+
allowed_clients = "0.0.0.0/0"
1270+
nfsv3 = true
1271+
}
1272+
}
1273+
}
1274+
1275+
data "google_compute_network" "default" {
1276+
provider = google-beta
1277+
name = "%{network_name}"
1278+
}
1279+
`, context)
1280+
}
1281+
1282+
func testAccNetappVolume_volumeExportPolicyWithoutSquashModeUpdate(context map[string]interface{}) string {
1283+
return acctest.Nprintf(`
1284+
resource "google_netapp_storage_pool" "default" {
1285+
provider = google-beta
1286+
name = "tf-test-pool%{random_suffix}"
1287+
location = "northamerica-northeast1"
1288+
service_level = "PREMIUM"
1289+
capacity_gib = "2048"
1290+
network = data.google_compute_network.default.id
1291+
}
1292+
resource "time_sleep" "wait_3_minutes" {
1293+
depends_on = [google_netapp_storage_pool.default]
1294+
create_duration = "3m"
1295+
}
1296+
resource "google_netapp_volume" "test_volume" {
1297+
provider = google-beta
1298+
location = "northamerica-northeast1"
1299+
name = "tf-test-test-volume%{random_suffix}"
1300+
capacity_gib = "200"
1301+
share_name = "tf-test-test-volume%{random_suffix}"
1302+
storage_pool = google_netapp_storage_pool.default.name
1303+
protocols = ["NFSV3"]
1304+
export_policy {
1305+
rules {
1306+
access_type = "READ_NONE"
1307+
allowed_clients = "0.0.0.0/0"
1308+
nfsv3 = true
1309+
}
1310+
}
1311+
}
1312+
1313+
data "google_compute_network" "default" {
1314+
provider = google-beta
1315+
name = "%{network_name}"
1316+
}
1317+
`, context)
1318+
}
12251319
{{ end }}

0 commit comments

Comments
 (0)