Skip to content

Commit 32e7e4c

Browse files
Fix Filestore quota usage (#8211) (#5819)
Signed-off-by: Modular Magician <[email protected]>
1 parent a1000f3 commit 32e7e4c

9 files changed

+93
-88
lines changed

.changelog/8211.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```release-note:none
2+
```

google-beta/resource_filestore_backup_generated_test.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,30 @@ func TestAccFilestoreBackup_filestoreBackupBasicExample(t *testing.T) {
5757

5858
func testAccFilestoreBackup_filestoreBackupBasicExample(context map[string]interface{}) string {
5959
return tpgresource.Nprintf(`
60-
6160
resource "google_filestore_instance" "instance" {
62-
name = "tf-test-tf-fs-inst%{random_suffix}"
61+
name = "tf-test-tf-fs-inst%{random_suffix}"
6362
location = "us-central1-b"
64-
tier = "BASIC_SSD"
63+
tier = "BASIC_HDD"
6564
6665
file_shares {
67-
capacity_gb = 2560
66+
capacity_gb = 1024
6867
name = "share1"
6968
}
7069
7170
networks {
72-
network = "default"
73-
modes = ["MODE_IPV4"]
71+
network = "default"
72+
modes = ["MODE_IPV4"]
7473
connect_mode = "DIRECT_PEERING"
7574
}
7675
}
7776
7877
resource "google_filestore_backup" "backup" {
79-
name = "tf-test-tf-fs-bkup%{random_suffix}"
80-
location = "us-central1"
78+
name = "tf-test-tf-fs-bkup%{random_suffix}"
79+
location = "us-central1"
80+
description = "This is a filestore backup for the test instance"
8181
source_instance = google_filestore_instance.instance.id
8282
source_file_share = "share1"
8383
84-
description = "This is a filestore backup for the test instance"
8584
labels = {
8685
"files":"label1",
8786
"other-label": "label2"

google-beta/resource_filestore_backup_test.go

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ func TestAccFilestoreBackup_update(t *testing.T) {
4646
func testAccFilestoreBackup_create(instName string, bkupName string) string {
4747
return fmt.Sprintf(`
4848
resource "google_filestore_instance" "instance" {
49-
name = "%s"
50-
location = "us-central1-b"
51-
tier = "BASIC_SSD"
49+
name = "%s"
50+
location = "us-central1-b"
51+
tier = "BASIC_HDD"
52+
description = "An instance created during testing."
5253
5354
file_shares {
54-
capacity_gb = 2560
55+
capacity_gb = 1024
5556
name = "share22"
5657
}
5758
5859
networks {
59-
network = "default"
60-
modes = ["MODE_IPV4"]
60+
network = "default"
61+
modes = ["MODE_IPV4"]
6162
connect_mode = "DIRECT_PEERING"
6263
}
63-
description = "An instance created during testing."
6464
}
6565
6666
resource "google_filestore_backup" "backup" {
@@ -78,27 +78,26 @@ resource "google_filestore_backup" "backup" {
7878
func testAccFilestoreBackup_update(instName string, bkupName string) string {
7979
return fmt.Sprintf(`
8080
resource "google_filestore_instance" "instance" {
81-
name = "%s"
82-
location = "us-central1-b"
83-
tier = "BASIC_SSD"
81+
name = "%s"
82+
location = "us-central1-b"
83+
tier = "BASIC_HDD"
84+
description = "A modified instance during testing."
8485
8586
file_shares {
86-
capacity_gb = 2560
87+
capacity_gb = 1024
8788
name = "share22"
8889
}
8990
9091
networks {
91-
network = "default"
92-
modes = ["MODE_IPV4"]
92+
network = "default"
93+
modes = ["MODE_IPV4"]
9394
connect_mode = "DIRECT_PEERING"
9495
}
9596
9697
labels = {
97-
"files":"label1",
98-
"other-label": "update"
98+
"files" : "label1",
99+
"other-label": "update"
99100
}
100-
101-
description = "A modified instance during testing."
102101
}
103102
104103
resource "google_filestore_backup" "backup" {

google-beta/resource_filestore_instance_generated_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ func TestAccFilestoreInstance_filestoreInstanceBasicExample(t *testing.T) {
5858
func testAccFilestoreInstance_filestoreInstanceBasicExample(context map[string]interface{}) string {
5959
return tpgresource.Nprintf(`
6060
resource "google_filestore_instance" "instance" {
61-
name = "tf-test-test-instance%{random_suffix}"
61+
name = "tf-test-test-instance%{random_suffix}"
6262
location = "us-central1-b"
63-
tier = "PREMIUM"
63+
tier = "BASIC_HDD"
6464
6565
file_shares {
66-
capacity_gb = 2660
66+
capacity_gb = 1024
6767
name = "share1"
6868
}
6969
@@ -103,32 +103,32 @@ func TestAccFilestoreInstance_filestoreInstanceFullExample(t *testing.T) {
103103
func testAccFilestoreInstance_filestoreInstanceFullExample(context map[string]interface{}) string {
104104
return tpgresource.Nprintf(`
105105
resource "google_filestore_instance" "instance" {
106-
name = "tf-test-test-instance%{random_suffix}"
106+
name = "tf-test-test-instance%{random_suffix}"
107107
location = "us-central1-b"
108-
tier = "BASIC_SSD"
108+
tier = "BASIC_SSD"
109109
110110
file_shares {
111-
capacity_gb = 2660
111+
capacity_gb = 2560
112112
name = "share1"
113113
114114
nfs_export_options {
115-
ip_ranges = ["10.0.0.0/24"]
115+
ip_ranges = ["10.0.0.0/24"]
116116
access_mode = "READ_WRITE"
117117
squash_mode = "NO_ROOT_SQUASH"
118-
}
118+
}
119119
120-
nfs_export_options {
121-
ip_ranges = ["10.10.0.0/24"]
120+
nfs_export_options {
121+
ip_ranges = ["10.10.0.0/24"]
122122
access_mode = "READ_ONLY"
123123
squash_mode = "ROOT_SQUASH"
124-
anon_uid = 123
125-
anon_gid = 456
126-
}
124+
anon_uid = 123
125+
anon_gid = 456
126+
}
127127
}
128128
129129
networks {
130-
network = "default"
131-
modes = ["MODE_IPV4"]
130+
network = "default"
131+
modes = ["MODE_IPV4"]
132132
connect_mode = "DIRECT_PEERING"
133133
}
134134
}

google-beta/resource_filestore_instance_test.go

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,40 +76,45 @@ func TestAccFilestoreInstance_update(t *testing.T) {
7676
func testAccFilestoreInstance_update(name string) string {
7777
return fmt.Sprintf(`
7878
resource "google_filestore_instance" "instance" {
79-
name = "tf-instance-%s"
80-
zone = "us-central1-b"
79+
name = "tf-instance-%s"
80+
zone = "us-central1-b"
81+
tier = "BASIC_HDD"
82+
description = "An instance created during testing."
83+
8184
file_shares {
82-
capacity_gb = 2660
85+
capacity_gb = 1024
8386
name = "share"
8487
}
88+
8589
networks {
8690
network = "default"
8791
modes = ["MODE_IPV4"]
8892
}
93+
8994
labels = {
9095
baz = "qux"
9196
}
92-
tier = "PREMIUM"
93-
description = "An instance created during testing."
9497
}
9598
`, name)
9699
}
97100

98101
func testAccFilestoreInstance_update2(name string) string {
99102
return fmt.Sprintf(`
100103
resource "google_filestore_instance" "instance" {
101-
name = "tf-instance-%s"
102-
zone = "us-central1-b"
104+
name = "tf-instance-%s"
105+
zone = "us-central1-b"
106+
tier = "BASIC_HDD"
107+
description = "A modified instance created during testing."
108+
103109
file_shares {
104-
capacity_gb = 2760
110+
capacity_gb = 1536
105111
name = "share"
106112
}
113+
107114
networks {
108115
network = "default"
109116
modes = ["MODE_IPV4"]
110117
}
111-
tier = "PREMIUM"
112-
description = "A modified instance created during testing."
113118
}
114119
`, name)
115120
}
@@ -151,7 +156,7 @@ func testAccFilestoreInstance_reservedIpRange_update(name string) string {
151156
resource "google_filestore_instance" "instance" {
152157
name = "tf-instance-%s"
153158
zone = "us-central1-b"
154-
tier = "BASIC_HDD"
159+
tier = "BASIC_HDD"
155160
156161
file_shares {
157162
capacity_gb = 1024
@@ -172,7 +177,7 @@ func testAccFilestoreInstance_reservedIpRange_update2(name string) string {
172177
resource "google_filestore_instance" "instance" {
173178
name = "tf-instance-%s"
174179
zone = "us-central1-b"
175-
tier = "BASIC_HDD"
180+
tier = "BASIC_HDD"
176181
177182
file_shares {
178183
capacity_gb = 1024

google-beta/resource_filestore_snapshot_generated_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ func testAccFilestoreSnapshot_filestoreSnapshotBasicExample(context map[string]i
6060
resource "google_filestore_snapshot" "snapshot" {
6161
name = "tf-test-test-snapshot%{random_suffix}"
6262
instance = google_filestore_instance.instance.name
63-
location = "us-central1"
63+
location = "us-east1"
6464
}
6565
6666
resource "google_filestore_instance" "instance" {
6767
name = "tf-test-test-instance-for-snapshot%{random_suffix}"
68-
location = "us-central1"
68+
location = "us-east1"
6969
tier = "ENTERPRISE"
7070
7171
file_shares {
@@ -111,7 +111,7 @@ func testAccFilestoreSnapshot_filestoreSnapshotFullExample(context map[string]in
111111
resource "google_filestore_snapshot" "snapshot" {
112112
name = "tf-test-test-snapshot%{random_suffix}"
113113
instance = google_filestore_instance.instance.name
114-
location = "us-central1"
114+
location = "us-west1"
115115
116116
description = "Snapshot of tf-test-test-instance-for-snapshot%{random_suffix}"
117117
@@ -122,7 +122,7 @@ resource "google_filestore_snapshot" "snapshot" {
122122
123123
resource "google_filestore_instance" "instance" {
124124
name = "tf-test-test-instance-for-snapshot%{random_suffix}"
125-
location = "us-central1"
125+
location = "us-west1"
126126
tier = "ENTERPRISE"
127127
128128
file_shares {

website/docs/r/filestore_backup.html.markdown

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,30 @@ To get more information about Backup, see:
3838

3939

4040
```hcl
41-
4241
resource "google_filestore_instance" "instance" {
43-
name = "tf-fs-inst"
42+
name = "tf-fs-inst"
4443
location = "us-central1-b"
45-
tier = "BASIC_SSD"
44+
tier = "BASIC_HDD"
4645
4746
file_shares {
48-
capacity_gb = 2560
47+
capacity_gb = 1024
4948
name = "share1"
5049
}
5150
5251
networks {
53-
network = "default"
54-
modes = ["MODE_IPV4"]
52+
network = "default"
53+
modes = ["MODE_IPV4"]
5554
connect_mode = "DIRECT_PEERING"
5655
}
5756
}
5857
5958
resource "google_filestore_backup" "backup" {
60-
name = "tf-fs-bkup"
61-
location = "us-central1"
59+
name = "tf-fs-bkup"
60+
location = "us-central1"
61+
description = "This is a filestore backup for the test instance"
6262
source_instance = google_filestore_instance.instance.id
6363
source_file_share = "share1"
6464
65-
description = "This is a filestore backup for the test instance"
6665
labels = {
6766
"files":"label1",
6867
"other-label": "label2"

0 commit comments

Comments
 (0)