From 31b9e30d90c1c36d32db11026ced6fbbdc99c490 Mon Sep 17 00:00:00 2001 From: soumyapani <112522451+soumyapani@users.noreply.github.com> Date: Thu, 4 May 2023 14:58:13 -0700 Subject: [PATCH 1/8] Adding GCFuse addons attributes in GKE terraform resource. --- .../resource_container_cluster.go.erb | 34 +++++++++++++++++++ .../resource_container_cluster_test.go.erb | 6 ++++ .../docs/r/container_cluster.html.markdown | 4 +++ 3 files changed, 44 insertions(+) diff --git a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb index 11cad489a8af..2e2e86c0bd10 100644 --- a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb @@ -75,6 +75,7 @@ var ( "addons_config.0.network_policy_config", "addons_config.0.cloudrun_config", "addons_config.0.gcp_filestore_csi_driver_config", + "addons_config.0.gcs_fuse_csi_driver_config", "addons_config.0.dns_cache_config", "addons_config.0.gce_persistent_disk_csi_driver_config", "addons_config.0.gke_backup_agent_config", @@ -331,6 +332,23 @@ func ResourceContainerCluster() *schema.Resource { }, }, }, + "gcs_fuse_csi_driver_config": { + Type: schema.TypeList, + Optional: true, + Computed: true, + AtLeastOneOf: addonsConfigKeys, + MaxItems: 1, + Description: `The status of the GCS Fuse CSI driver addon, which allows the usage of gcs bucket as volumes. Defaults to disabled; set enabled = true to enable.`, + ConflictsWith: []string{"enable_autopilot"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + } "cloudrun_config": { Type: schema.TypeList, Optional: true, @@ -3928,6 +3946,14 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig { } } + if v, ok := config["gcs_fuse_csi_driver_config"]; ok && len(v.([]interface{})) > 0 { + addon := v.([]interface{})[0].(map[string]interface{}) + ac.GcsFuseCsiDriverConfig = &container.GcsFuseCsiDriverConfig{ + Enabled: addon["enabled"].(bool), + ForceSendFields: []string{"Enabled"}, + } + } + if v, ok := config["cloudrun_config"]; ok && len(v.([]interface{})) > 0 { addon := v.([]interface{})[0].(map[string]interface{}) ac.CloudRunConfig = &container.CloudRunConfig{ @@ -4977,6 +5003,14 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac } } + if c.GcsFuseCsiDriverConfig != nil { + result["gcs_fuse_csi_driver_config"] = []map[string]interface{}{ + { + "enabled": c.GcsFuseCsiDriverConfig.Enabled, + }, + } + } + if c.CloudRunConfig != nil { cloudRunConfig := map[string]interface{}{ "disabled": c.CloudRunConfig.Disabled, diff --git a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb index e345ecc49131..a9f234c73992 100644 --- a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb @@ -3897,6 +3897,9 @@ resource "google_container_cluster" "primary" { gcp_filestore_csi_driver_config { enabled = false } + gcs_fuse_csi_driver_config { + enabled = false + } cloudrun_config { disabled = true } @@ -3956,6 +3959,9 @@ resource "google_container_cluster" "primary" { gcp_filestore_csi_driver_config { enabled = true } + gcs_fuse_csi_driver_config { + enabled = true + } cloudrun_config { # https://github.com/hashicorp/terraform-provider-google/issues/11943 # disabled = false diff --git a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown index 601c3cbb6e2e..cca13367f424 100644 --- a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown @@ -391,6 +391,10 @@ subnetwork in which the cluster's instances are launched. which allows the usage of filestore instance as volumes. It is disabled by default; set `enabled = true` to enable. +* `gcs_fuse_csi_driver_config` - (Optional) The status of the GCSFuse CSI driver addon, + which allows the usage of a gcs bucket as volumes. + It is disabled by default; set `enabled = true` to enable. + * `cloudrun_config` - (Optional). Structure is [documented below](#nested_cloudrun_config). * `istio_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)). From eae398186bb9c2354a87162565446cf80df6939b Mon Sep 17 00:00:00 2001 From: soumyapani <112522451+soumyapani@users.noreply.github.com> Date: Thu, 4 May 2023 14:58:39 -0700 Subject: [PATCH 2/8] Fixing syntax error. --- .../terraform/resources/resource_container_cluster.go.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb index 2e2e86c0bd10..368b7fb8ef4b 100644 --- a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb @@ -348,7 +348,7 @@ func ResourceContainerCluster() *schema.Resource { }, }, }, - } + }, "cloudrun_config": { Type: schema.TypeList, Optional: true, From cafa96b8cdf7a6233563933986ad3a4d3b338ab8 Mon Sep 17 00:00:00 2001 From: soumyapani <112522451+soumyapani@users.noreply.github.com> Date: Fri, 5 May 2023 14:52:39 -0700 Subject: [PATCH 3/8] Updating go.mud and go.sum files. --- mmv1/third_party/terraform/go.mod.erb | 6 +++--- mmv1/third_party/terraform/go.sum | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/mmv1/third_party/terraform/go.mod.erb b/mmv1/third_party/terraform/go.mod.erb index b96e75059ba4..51e3e28fb174 100644 --- a/mmv1/third_party/terraform/go.mod.erb +++ b/mmv1/third_party/terraform/go.mod.erb @@ -27,8 +27,8 @@ require ( github.com/sirupsen/logrus v1.8.1 golang.org/x/net v0.9.0 golang.org/x/oauth2 v0.7.0 - google.golang.org/api v0.117.0 - google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd + google.golang.org/api v0.121.0 + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 google.golang.org/grpc v1.54.0 google.golang.org/protobuf v1.30.0 ) @@ -56,7 +56,7 @@ require ( github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932 // indirect - github.com/google/s2a-go v0.1.0 // indirect + github.com/google/s2a-go v0.1.3 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect github.com/googleapis/gax-go/v2 v2.8.0 // indirect diff --git a/mmv1/third_party/terraform/go.sum b/mmv1/third_party/terraform/go.sum index 26cf61b569d9..f045f8cfea51 100644 --- a/mmv1/third_party/terraform/go.sum +++ b/mmv1/third_party/terraform/go.sum @@ -208,6 +208,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.0 h1:3Qm0liEiCErViKERO2Su5wp+9PfMRiuS6XB5FvpKnYQ= github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= +github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= +github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -376,6 +378,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= @@ -405,6 +408,7 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -440,6 +444,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -476,6 +481,8 @@ golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5o golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -496,6 +503,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -541,9 +549,12 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -553,6 +564,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -601,6 +613,7 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -625,6 +638,8 @@ google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSr google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/api v0.117.0 h1:JsXRperckxXjnPl42ku4+KQRhWFiW6XjcZlOEHoxG8M= google.golang.org/api v0.117.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E= +google.golang.org/api v0.121.0 h1:8Oopoo8Vavxx6gt+sgs8s8/X60WBAtKQq6JqnkF+xow= +google.golang.org/api v0.121.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -668,6 +683,8 @@ google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd h1:sLpv7bNL1AsX3fdnWh9WVh7ejIzXdOc1RRHGeAmeStU= google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -733,5 +750,3 @@ rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -github.com/GoogleCloudPlatform/declarative-resource-client-library v1.39.0 h1:js9wqpbWMsjRUWCezgiw+bmZ4Jke9nkcQJLjdnQZwpc= -github.com/GoogleCloudPlatform/declarative-resource-client-library v1.39.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k= From 19a928a50e38d8da1f7164812a0fd8141427b8ce Mon Sep 17 00:00:00 2001 From: soumyapani <112522451+soumyapani@users.noreply.github.com> Date: Tue, 9 May 2023 12:03:19 -0700 Subject: [PATCH 4/8] Moving "gcp_filestore_csi_driver_config" to "ga" block to include it only in google-beta version. --- .../terraform/resources/resource_container_cluster.go.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb index 368b7fb8ef4b..9c01b2ccd595 100644 --- a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb @@ -74,7 +74,6 @@ var ( "addons_config.0.horizontal_pod_autoscaling", "addons_config.0.network_policy_config", "addons_config.0.cloudrun_config", - "addons_config.0.gcp_filestore_csi_driver_config", "addons_config.0.gcs_fuse_csi_driver_config", "addons_config.0.dns_cache_config", "addons_config.0.gce_persistent_disk_csi_driver_config", @@ -83,6 +82,7 @@ var ( <% unless version == 'ga' -%> "addons_config.0.istio_config", "addons_config.0.kalm_config", + "addons_config.0.gcp_filestore_csi_driver_config", <% end -%> } From f2c10204ef38eb10a74315dd6b1b625d7af84800 Mon Sep 17 00:00:00 2001 From: soumyapani <112522451+soumyapani@users.noreply.github.com> Date: Tue, 9 May 2023 12:13:08 -0700 Subject: [PATCH 5/8] Update mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown Co-authored-by: megan07 --- .../terraform/website/docs/r/container_cluster.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown index cca13367f424..4fa14770adf2 100644 --- a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown @@ -391,7 +391,7 @@ subnetwork in which the cluster's instances are launched. which allows the usage of filestore instance as volumes. It is disabled by default; set `enabled = true` to enable. -* `gcs_fuse_csi_driver_config` - (Optional) The status of the GCSFuse CSI driver addon, +* `gcs_fuse_csi_driver_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))) The status of the GCSFuse CSI driver addon, which allows the usage of a gcs bucket as volumes. It is disabled by default; set `enabled = true` to enable. From f0c6a28410941559c1e7bbe40528837aa4015bdb Mon Sep 17 00:00:00 2001 From: soumyapani <112522451+soumyapani@users.noreply.github.com> Date: Tue, 9 May 2023 12:13:45 -0700 Subject: [PATCH 6/8] Updating "gcs_fuse_csi_driver_config" location. --- .../resource_container_cluster.go.erb | 66 +++++++++---------- .../resource_container_cluster_test.go.erb | 12 ++-- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb index 9c01b2ccd595..d340d72d7001 100644 --- a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb @@ -332,23 +332,6 @@ func ResourceContainerCluster() *schema.Resource { }, }, }, - "gcs_fuse_csi_driver_config": { - Type: schema.TypeList, - Optional: true, - Computed: true, - AtLeastOneOf: addonsConfigKeys, - MaxItems: 1, - Description: `The status of the GCS Fuse CSI driver addon, which allows the usage of gcs bucket as volumes. Defaults to disabled; set enabled = true to enable.`, - ConflictsWith: []string{"enable_autopilot"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "enabled": { - Type: schema.TypeBool, - Required: true, - }, - }, - }, - }, "cloudrun_config": { Type: schema.TypeList, Optional: true, @@ -461,6 +444,23 @@ func ResourceContainerCluster() *schema.Resource { }, }, }, + "gcs_fuse_csi_driver_config": { + Type: schema.TypeList, + Optional: true, + Computed: true, + AtLeastOneOf: addonsConfigKeys, + MaxItems: 1, + Description: `The status of the GCS Fuse CSI driver addon, which allows the usage of gcs bucket as volumes. Defaults to disabled; set enabled = true to enable.`, + ConflictsWith: []string{"enable_autopilot"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + }, <% end -%> "config_connector_config": { Type: schema.TypeList, @@ -3946,14 +3946,6 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig { } } - if v, ok := config["gcs_fuse_csi_driver_config"]; ok && len(v.([]interface{})) > 0 { - addon := v.([]interface{})[0].(map[string]interface{}) - ac.GcsFuseCsiDriverConfig = &container.GcsFuseCsiDriverConfig{ - Enabled: addon["enabled"].(bool), - ForceSendFields: []string{"Enabled"}, - } - } - if v, ok := config["cloudrun_config"]; ok && len(v.([]interface{})) > 0 { addon := v.([]interface{})[0].(map[string]interface{}) ac.CloudRunConfig = &container.CloudRunConfig{ @@ -4012,6 +4004,14 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig { ForceSendFields: []string{"Enabled"}, } } + + if v, ok := config["gcs_fuse_csi_driver_config"]; ok && len(v.([]interface{})) > 0 { + addon := v.([]interface{})[0].(map[string]interface{}) + ac.GcsFuseCsiDriverConfig = &container.GcsFuseCsiDriverConfig{ + Enabled: addon["enabled"].(bool), + ForceSendFields: []string{"Enabled"}, + } + } <% end -%> return ac @@ -5003,14 +5003,6 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac } } - if c.GcsFuseCsiDriverConfig != nil { - result["gcs_fuse_csi_driver_config"] = []map[string]interface{}{ - { - "enabled": c.GcsFuseCsiDriverConfig.Enabled, - }, - } - } - if c.CloudRunConfig != nil { cloudRunConfig := map[string]interface{}{ "disabled": c.CloudRunConfig.Disabled, @@ -5069,6 +5061,14 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac }, } } + + if c.GcsFuseCsiDriverConfig != nil { + result["gcs_fuse_csi_driver_config"] = []map[string]interface{}{ + { + "enabled": c.GcsFuseCsiDriverConfig.Enabled, + }, + } + } <% end -%> return []map[string]interface{}{result} } diff --git a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb index a9f234c73992..bb28c09b5453 100644 --- a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb @@ -3897,9 +3897,6 @@ resource "google_container_cluster" "primary" { gcp_filestore_csi_driver_config { enabled = false } - gcs_fuse_csi_driver_config { - enabled = false - } cloudrun_config { disabled = true } @@ -3923,6 +3920,9 @@ resource "google_container_cluster" "primary" { kalm_config { enabled = false } + gcs_fuse_csi_driver_config { + enabled = false + } <% end -%> } } @@ -3959,9 +3959,6 @@ resource "google_container_cluster" "primary" { gcp_filestore_csi_driver_config { enabled = true } - gcs_fuse_csi_driver_config { - enabled = true - } cloudrun_config { # https://github.com/hashicorp/terraform-provider-google/issues/11943 # disabled = false @@ -3987,6 +3984,9 @@ resource "google_container_cluster" "primary" { kalm_config { enabled = true } + gcs_fuse_csi_driver_config { + enabled = true + } <% end -%> } } From 9004199dc6f7bdf65176588c751a3c5739c5545e Mon Sep 17 00:00:00 2001 From: soumyapani <112522451+soumyapani@users.noreply.github.com> Date: Tue, 9 May 2023 12:53:01 -0700 Subject: [PATCH 7/8] Fixing the error and moving the right gcs_fuse_csi_driver_config attribute. --- .../terraform/resources/resource_container_cluster.go.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb index d340d72d7001..cccb95c1138e 100644 --- a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb @@ -74,7 +74,7 @@ var ( "addons_config.0.horizontal_pod_autoscaling", "addons_config.0.network_policy_config", "addons_config.0.cloudrun_config", - "addons_config.0.gcs_fuse_csi_driver_config", + "addons_config.0.gcp_filestore_csi_driver_config", "addons_config.0.dns_cache_config", "addons_config.0.gce_persistent_disk_csi_driver_config", "addons_config.0.gke_backup_agent_config", @@ -82,7 +82,7 @@ var ( <% unless version == 'ga' -%> "addons_config.0.istio_config", "addons_config.0.kalm_config", - "addons_config.0.gcp_filestore_csi_driver_config", + "addons_config.0.gcs_fuse_csi_driver_config", <% end -%> } From 1e3f33c84954c147bbc641bed181ddc936f4518f Mon Sep 17 00:00:00 2001 From: soumyapani <112522451+soumyapani@users.noreply.github.com> Date: Tue, 9 May 2023 12:56:55 -0700 Subject: [PATCH 8/8] Fixing spacing. --- .../tests/resource_container_cluster_test.go.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb index bb28c09b5453..594feaf13f4f 100644 --- a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb @@ -3918,9 +3918,9 @@ resource "google_container_cluster" "primary" { auth = "AUTH_MUTUAL_TLS" } kalm_config { - enabled = false - } - gcs_fuse_csi_driver_config { + enabled = false + } + gcs_fuse_csi_driver_config { enabled = false } <% end -%> @@ -3981,10 +3981,10 @@ resource "google_container_cluster" "primary" { disabled = false auth = "AUTH_NONE" } - kalm_config { - enabled = true - } - gcs_fuse_csi_driver_config { + kalm_config { + enabled = true + } + gcs_fuse_csi_driver_config { enabled = true } <% end -%>