Skip to content

Commit

Permalink
move gcs_fuse_csi_driver_config to GA (GoogleCloudPlatform#8411)
Browse files Browse the repository at this point in the history
  • Loading branch information
songjiaxun authored and NickElliot committed Jul 31, 2023
1 parent 84eef75 commit cce9f13
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ var (
"addons_config.0.gce_persistent_disk_csi_driver_config",
"addons_config.0.gke_backup_agent_config",
"addons_config.0.config_connector_config",
"addons_config.0.gcs_fuse_csi_driver_config",
<% unless version == 'ga' -%>
"addons_config.0.istio_config",
"addons_config.0.kalm_config",
"addons_config.0.gcs_fuse_csi_driver_config",
<% end -%>
}

Expand Down Expand Up @@ -402,6 +402,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,
},
},
},
},
<% unless version == 'ga' -%>
"istio_config": {
Type: schema.TypeList,
Expand Down Expand Up @@ -444,23 +461,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,
},
},
},
},
<% end -%>
"config_connector_config": {
Type: schema.TypeList,
Expand Down Expand Up @@ -4077,6 +4077,13 @@ 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"},
}
}

<% unless version == 'ga' -%>
if v, ok := config["istio_config"]; ok && len(v.([]interface{})) > 0 {
Expand All @@ -4095,14 +4102,6 @@ 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
Expand Down Expand Up @@ -5167,6 +5166,13 @@ 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,
},
}
}

<% unless version == 'ga' -%>
if c.IstioConfig != nil {
Expand All @@ -5185,14 +5191,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,
},
}
}
<% end -%>
return []map[string]interface{}{result}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4011,6 +4011,9 @@ resource "google_container_cluster" "primary" {
config_connector_config {
enabled = false
}
gcs_fuse_csi_driver_config {
enabled = false
}
<% unless version == 'ga' -%>
istio_config {
disabled = true
Expand All @@ -4019,9 +4022,6 @@ resource "google_container_cluster" "primary" {
kalm_config {
enabled = false
}
gcs_fuse_csi_driver_config {
enabled = false
}
<% end -%>
}
}
Expand Down Expand Up @@ -4075,6 +4075,9 @@ resource "google_container_cluster" "primary" {
config_connector_config {
enabled = true
}
gcs_fuse_csi_driver_config {
enabled = true
}
<% unless version == 'ga' -%>
istio_config {
disabled = false
Expand All @@ -4083,9 +4086,6 @@ resource "google_container_cluster" "primary" {
kalm_config {
enabled = true
}
gcs_fuse_csi_driver_config {
enabled = true
}
<% end -%>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ Enable/Disable Security Posture API features for the cluster. Structure is [docu
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, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))) The status of the GCSFuse CSI driver addon,
* `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.

Expand Down

0 comments on commit cce9f13

Please sign in to comment.