From 0f1a60aadfc50d8918aad66d6fcb2ef2fa6e8169 Mon Sep 17 00:00:00 2001 From: Daniele Rossi Date: Thu, 28 Mar 2024 15:48:07 +0100 Subject: [PATCH 1/5] Add protocol field for filestore Instance product --- mmv1/products/filestore/Instance.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mmv1/products/filestore/Instance.yaml b/mmv1/products/filestore/Instance.yaml index fe5b9333000f..4cfdbe46f48e 100644 --- a/mmv1/products/filestore/Instance.yaml +++ b/mmv1/products/filestore/Instance.yaml @@ -98,6 +98,15 @@ properties: Possible values include: STANDARD, PREMIUM, BASIC_HDD, BASIC_SSD, HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE required: true immutable: true + - !ruby/object:Api::Type::Enum + name: 'protocol' + description: | + Either NFSv3, for using NFS version 3 as file sharing protocol, + or NFSv4.1, for using NFS version 4.1 as file sharing protocol. The default is NFSv3. + default_value: :NFS_V3 + values: + - :NFS_V3 + - :NFS_V4_1 - !ruby/object:Api::Type::KeyValueLabels name: 'labels' description: | From ce6c49d5598adecce1cd7c70a48271d4844f2345 Mon Sep 17 00:00:00 2001 From: Daniele Rossi Date: Fri, 29 Mar 2024 14:31:19 +0100 Subject: [PATCH 2/5] Add detailed description. Add new test. --- mmv1/products/filestore/Instance.yaml | 12 +++++++++++- .../filestore_instance_protocol.tf.erb | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 mmv1/templates/terraform/examples/filestore_instance_protocol.tf.erb diff --git a/mmv1/products/filestore/Instance.yaml b/mmv1/products/filestore/Instance.yaml index 4cfdbe46f48e..dd9dc7f3924a 100644 --- a/mmv1/products/filestore/Instance.yaml +++ b/mmv1/products/filestore/Instance.yaml @@ -41,6 +41,12 @@ examples: primary_resource_id: 'instance' vars: instance_name: 'test-instance' + - !ruby/object:Provider::Terraform::Examples + name: 'filestore_instance_protocol' + primary_resource_id: 'instance' + min_version: beta + vars: + instance_name: 'test-instance' - !ruby/object:Provider::Terraform::Examples name: 'filestore_instance_enterprise' primary_resource_id: 'instance' @@ -102,8 +108,12 @@ properties: name: 'protocol' description: | Either NFSv3, for using NFS version 3 as file sharing protocol, - or NFSv4.1, for using NFS version 4.1 as file sharing protocol. The default is NFSv3. + or NFSv4.1, for using NFS version 4.1 as file sharing protocol. + NFSv4.1 can be used with HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE. + The default is NFSv3. default_value: :NFS_V3 + min_version: 'beta' + immutable: true values: - :NFS_V3 - :NFS_V4_1 diff --git a/mmv1/templates/terraform/examples/filestore_instance_protocol.tf.erb b/mmv1/templates/terraform/examples/filestore_instance_protocol.tf.erb new file mode 100644 index 000000000000..c7cb489a814f --- /dev/null +++ b/mmv1/templates/terraform/examples/filestore_instance_protocol.tf.erb @@ -0,0 +1,18 @@ +resource "google_filestore_instance" "<%= ctx[:primary_resource_id] %>" { + provider = google-beta + name = "<%= ctx[:vars]["instance_name"] %>" + location = "us-central1" + tier = "ENTERPRISE" + protocol = "NFS_V4_1" + + file_shares { + capacity_gb = 1024 + name = "share1" + } + + networks { + network = "default" + modes = ["MODE_IPV4"] + } + +} From 203400f3251e263b0edecd4ede9d5ef25c671640 Mon Sep 17 00:00:00 2001 From: Daniele Rossi Date: Fri, 29 Mar 2024 14:49:51 +0100 Subject: [PATCH 3/5] Remove trailing spaces --- mmv1/products/filestore/Instance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/products/filestore/Instance.yaml b/mmv1/products/filestore/Instance.yaml index dd9dc7f3924a..847847731424 100644 --- a/mmv1/products/filestore/Instance.yaml +++ b/mmv1/products/filestore/Instance.yaml @@ -108,7 +108,7 @@ properties: name: 'protocol' description: | Either NFSv3, for using NFS version 3 as file sharing protocol, - or NFSv4.1, for using NFS version 4.1 as file sharing protocol. + or NFSv4.1, for using NFS version 4.1 as file sharing protocol. NFSv4.1 can be used with HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE. The default is NFSv3. default_value: :NFS_V3 From f86d9a02776590d0782729c9be2291b3da881109 Mon Sep 17 00:00:00 2001 From: Daniele Rossi Date: Wed, 10 Apr 2024 19:09:20 +0200 Subject: [PATCH 4/5] Add protocol field to example_filestore_instance for tgc tests --- .../third_party/tgc/tests/data/example_filestore_instance.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mmv1/third_party/tgc/tests/data/example_filestore_instance.json b/mmv1/third_party/tgc/tests/data/example_filestore_instance.json index 576160f04183..c7b29f655583 100644 --- a/mmv1/third_party/tgc/tests/data/example_filestore_instance.json +++ b/mmv1/third_party/tgc/tests/data/example_filestore_instance.json @@ -24,8 +24,9 @@ "network": "default" } ], + "protocol": "NFS_V3", "tier": "BASIC_SSD" } } } -] +] \ No newline at end of file From 66902b721a5ff2d5de4ee396f76a64810a64ae45 Mon Sep 17 00:00:00 2001 From: Daniele Rossi Date: Wed, 17 Apr 2024 19:23:15 +0200 Subject: [PATCH 5/5] Add default_if_empty flatten --- mmv1/products/filestore/Instance.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mmv1/products/filestore/Instance.yaml b/mmv1/products/filestore/Instance.yaml index 847847731424..0dbb1ed51718 100644 --- a/mmv1/products/filestore/Instance.yaml +++ b/mmv1/products/filestore/Instance.yaml @@ -117,6 +117,7 @@ properties: values: - :NFS_V3 - :NFS_V4_1 + custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb' - !ruby/object:Api::Type::KeyValueLabels name: 'labels' description: |