Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container: bump gcsfs to GA #11542

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down Expand Up @@ -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{})
Expand All @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down Expand Up @@ -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{})
Expand All @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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" {
Expand All @@ -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(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<a name="nested_notification_config"></a>The `notification_config` block supports:

Expand Down