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

Promote gce_persistent_disk_csi_driver_config to GA #11999

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
3 changes: 3 additions & 0 deletions .changelog/6187.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
container: Promoted `gce_persistent_disk_csi_driver_config` addon in `google_container_cluster` resource to GA
```
33 changes: 33 additions & 0 deletions google/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ var (
"addons_config.0.cloudrun_config",
"addons_config.0.gcp_filestore_csi_driver_config",
"addons_config.0.dns_cache_config",
"addons_config.0.gce_persistent_disk_csi_driver_config",
}

forceNewClusterNodeConfigFields = []string{
Expand Down Expand Up @@ -285,6 +286,22 @@ func resourceContainerCluster() *schema.Resource {
},
},
},
"gce_persistent_disk_csi_driver_config": {
Type: schema.TypeList,
Optional: true,
Computed: true,
AtLeastOneOf: addonsConfigKeys,
MaxItems: 1,
Description: `Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. Defaults to enabled; set disabled = true to disable.`,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Type: schema.TypeBool,
Required: true,
},
},
},
},
},
},
},
Expand Down Expand Up @@ -2723,6 +2740,14 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig {
}
}

if v, ok := config["gce_persistent_disk_csi_driver_config"]; ok && len(v.([]interface{})) > 0 {
addon := v.([]interface{})[0].(map[string]interface{})
ac.GcePersistentDiskCsiDriverConfig = &container.GcePersistentDiskCsiDriverConfig{
Enabled: addon["enabled"].(bool),
ForceSendFields: []string{"Enabled"},
}
}

return ac
}

Expand Down Expand Up @@ -3303,6 +3328,14 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac
}
}

if c.GcePersistentDiskCsiDriverConfig != nil {
result["gce_persistent_disk_csi_driver_config"] = []map[string]interface{}{
{
"enabled": c.GcePersistentDiskCsiDriverConfig.Enabled,
},
}
}

return []map[string]interface{}{result}
}

Expand Down
12 changes: 9 additions & 3 deletions google/resource_container_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2379,7 +2379,10 @@ resource "google_container_cluster" "primary" {
cloudrun_config {
disabled = true
}
dns_cache_config {
dns_cache_config {
enabled = false
}
gce_persistent_disk_csi_driver_config {
enabled = false
}
}
Expand Down Expand Up @@ -2422,9 +2425,12 @@ resource "google_container_cluster" "primary" {
# disabled = false
disabled = true
}
dns_cache_config {
dns_cache_config {
enabled = true
}
}
gce_persistent_disk_csi_driver_config {
enabled = true
}
}
}
`, projectID, clusterName)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/container_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ subnetwork in which the cluster's instances are launched.
**Enabling/Disabling NodeLocal DNSCache in an existing cluster is a disruptive operation.
All cluster nodes running GKE 1.15 and higher are recreated.**

* `gce_persistent_disk_csi_driver_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)).
Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. Defaults to disabled; set `enabled = true` to enable.
* `gce_persistent_disk_csi_driver_config` - (Optional).
Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. Defaults to disabled; set `enabled = true` to enabled.

* `kalm_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)).
Configuration for the KALM addon, which manages the lifecycle of k8s. It is disabled by default; Set `enabled = true` to enable.
Expand Down