From 68ed54227beaded0367e8c08654697992067d32a Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 6 Sep 2024 19:36:07 -0400 Subject: [PATCH] container: bump gcsfs to GA Signed-off-by: drfaust92 --- .../terraform/services/container/go/node_config.go.tmpl | 3 +-- .../container/go/resource_container_cluster.go.tmpl | 4 ---- .../terraform/services/container/node_config.go.erb | 7 +++---- .../services/container/resource_container_cluster.go.erb | 4 ---- .../container/resource_container_cluster_test.go.erb | 8 ++------ .../website/docs/r/container_cluster.html.markdown | 2 +- 6 files changed, 7 insertions(+), 21 deletions(-) diff --git a/mmv1/third_party/terraform/services/container/go/node_config.go.tmpl b/mmv1/third_party/terraform/services/container/go/node_config.go.tmpl index 74fd6c15f8e6..0094d7eccf05 100644 --- a/mmv1/third_party/terraform/services/container/go/node_config.go.tmpl +++ b/mmv1/third_party/terraform/services/container/go/node_config.go.tmpl @@ -824,14 +824,13 @@ func expandNodeConfigDefaults(configured interface{}) *container.NodeConfigDefau }, } } -{{- if ne $.TargetVersionName "ga" }} if v, ok := config["gcfs_config"]; ok && len(v.([]interface{})) > 0 { gcfsConfig := v.([]interface{})[0].(map[string]interface{}) nodeConfigDefaults.GcfsConfig = &container.GcfsConfig{ Enabled: gcfsConfig["enabled"].(bool), } } -{{- end }} + return nodeConfigDefaults } diff --git a/mmv1/third_party/terraform/services/container/go/resource_container_cluster.go.tmpl b/mmv1/third_party/terraform/services/container/go/resource_container_cluster.go.tmpl index 7d43a21c88c1..af4fd692ad78 100644 --- a/mmv1/third_party/terraform/services/container/go/resource_container_cluster.go.tmpl +++ b/mmv1/third_party/terraform/services/container/go/resource_container_cluster.go.tmpl @@ -158,9 +158,7 @@ func clusterSchemaNodePoolDefaults() *schema.Schema { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "containerd_config": schemaContainerdConfig(), -{{- if ne $.TargetVersionName "ga" }} "gcfs_config": schemaGcfsConfig(), -{{- end }} "insecure_kubelet_readonly_port_enabled": schemaInsecureKubeletReadonlyPortEnabled(), "logging_variant": schemaLoggingVariant(), }, @@ -4351,7 +4349,6 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er } } -{{ if ne $.TargetVersionName `ga` -}} if d.HasChange("node_pool_defaults") && d.HasChange("node_pool_defaults.0.node_config_defaults.0.gcfs_config") { if v, ok := d.GetOk("node_pool_defaults.0.node_config_defaults.0.gcfs_config"); ok { gcfsConfig := v.([]interface{})[0].(map[string]interface{}) @@ -4372,7 +4369,6 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er log.Printf("[INFO] GKE cluster %s default gcfs config has been updated", d.Id()) } } -{{- end }} if d.HasChange("security_posture_config") { req := &container.UpdateClusterRequest{ diff --git a/mmv1/third_party/terraform/services/container/node_config.go.erb b/mmv1/third_party/terraform/services/container/node_config.go.erb index 6e7baca5ea8d..44126003152d 100644 --- a/mmv1/third_party/terraform/services/container/node_config.go.erb +++ b/mmv1/third_party/terraform/services/container/node_config.go.erb @@ -846,14 +846,14 @@ func expandNodeConfigDefaults(configured interface{}) *container.NodeConfigDefau }, } } -<% unless version == "ga" -%> + if v, ok := config["gcfs_config"]; ok && len(v.([]interface{})) > 0 { gcfsConfig := v.([]interface{})[0].(map[string]interface{}) nodeConfigDefaults.GcfsConfig = &container.GcfsConfig{ Enabled: gcfsConfig["enabled"].(bool), } } -<% end -%> + return nodeConfigDefaults } @@ -1479,9 +1479,8 @@ func flattenNodeConfigDefaults(c *container.NodeConfigDefaults) []map[string]int result[0]["logging_variant"] = flattenLoggingVariant(c.LoggingConfig) -<% unless version == 'ga' -%> result[0]["gcfs_config"] = flattenGcfsConfig(c.GcfsConfig) -<% end -%> + return result } diff --git a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb index 4cdf23a8d97f..059a003de489 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb @@ -159,9 +159,7 @@ func clusterSchemaNodePoolDefaults() *schema.Schema { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "containerd_config": schemaContainerdConfig(), -<% unless version == 'ga' -%> "gcfs_config": schemaGcfsConfig(), -<% end -%> "insecure_kubelet_readonly_port_enabled": schemaInsecureKubeletReadonlyPortEnabled(), "logging_variant": schemaLoggingVariant(), }, @@ -4401,7 +4399,6 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er } } -<% unless version == 'ga' -%> if d.HasChange("node_pool_defaults") && d.HasChange("node_pool_defaults.0.node_config_defaults.0.gcfs_config") { if v, ok := d.GetOk("node_pool_defaults.0.node_config_defaults.0.gcfs_config"); ok { gcfsConfig := v.([]interface{})[0].(map[string]interface{}) @@ -4422,7 +4419,6 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er log.Printf("[INFO] GKE cluster %s default gcfs config has been updated", d.Id()) } } -<% end -%> if d.HasChange("security_posture_config") { req := &container.UpdateClusterRequest{ diff --git a/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb b/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb index 3388dba3af02..f24fa62718bf 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb @@ -1869,7 +1869,6 @@ func TestAccContainerCluster_withAdvancedMachineFeaturesInNodePool(t *testing.T) }) } -<% unless version == 'ga' -%> func TestAccContainerCluster_withNodePoolDefaults(t *testing.T) { t.Parallel() clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10)) @@ -1924,10 +1923,9 @@ func TestAccContainerCluster_withNodePoolDefaults(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"deletion_protection"}, }, -}, + }, }) } -<% end -%> func TestAccContainerCluster_withNodeConfigScopeAlias(t *testing.T) { t.Parallel() @@ -6933,7 +6931,6 @@ resource "google_container_cluster" "with_advanced_machine_features_in_node_pool `, clusterName, nodePoolName, nvEnabled, networkName, subnetworkName) } -<% unless version == 'ga' -%> func testAccContainerCluster_withNodePoolDefaults(clusterName, enabled, networkName, subnetworkName string) string { return fmt.Sprintf(` resource "google_container_cluster" "with_node_pool_defaults" { @@ -6950,11 +6947,10 @@ resource "google_container_cluster" "with_node_pool_defaults" { } deletion_protection = false network = "%s" - subnetwork = "%s" + subnetwork = "%s" } `, clusterName, enabled, networkName, subnetworkName) } -<% end -%> func testAccContainerCluster_withNodeConfigUpdate(clusterName, networkName, subnetworkName string) string { return fmt.Sprintf(` 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 c4fc1f7c3a78..512283c150d9 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 @@ -1118,7 +1118,7 @@ The `node_config_defaults` block supports: * `logging_variant` (Optional) The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. See [Increasing logging agent throughput](https://cloud.google.com/stackdriver/docs/solutions/gke/managing-logs#throughput) for more information. -* `gcfs_config` (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) The default Google Container Filesystem (GCFS) configuration at the cluster level. e.g. enable [image streaming](https://cloud.google.com/kubernetes-engine/docs/how-to/image-streaming) across all the node pools within the cluster. Structure is [documented below](#nested_gcfs_config). +* `gcfs_config` (Optional) The default Google Container Filesystem (GCFS) configuration at the cluster level. e.g. enable [image streaming](https://cloud.google.com/kubernetes-engine/docs/how-to/image-streaming) across all the node pools within the cluster. Structure is [documented below](#nested_gcfs_config). The `notification_config` block supports: