6161 "addons_config.0.cloudrun_config" ,
6262 "addons_config.0.gcp_filestore_csi_driver_config" ,
6363 "addons_config.0.dns_cache_config" ,
64- "addons_config.0.istio_config" ,
6564 "addons_config.0.gce_persistent_disk_csi_driver_config" ,
65+ "addons_config.0.istio_config" ,
6666 "addons_config.0.kalm_config" ,
6767 "addons_config.0.config_connector_config" ,
6868 "addons_config.0.gke_backup_agent_config" ,
@@ -305,6 +305,22 @@ func resourceContainerCluster() *schema.Resource {
305305 },
306306 },
307307 },
308+ "gce_persistent_disk_csi_driver_config" : {
309+ Type : schema .TypeList ,
310+ Optional : true ,
311+ Computed : true ,
312+ AtLeastOneOf : addonsConfigKeys ,
313+ MaxItems : 1 ,
314+ 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.` ,
315+ Elem : & schema.Resource {
316+ Schema : map [string ]* schema.Schema {
317+ "enabled" : {
318+ Type : schema .TypeBool ,
319+ Required : true ,
320+ },
321+ },
322+ },
323+ },
308324 "istio_config" : {
309325 Type : schema .TypeList ,
310326 Optional : true ,
@@ -330,22 +346,6 @@ func resourceContainerCluster() *schema.Resource {
330346 },
331347 },
332348 },
333- "gce_persistent_disk_csi_driver_config" : {
334- Type : schema .TypeList ,
335- Optional : true ,
336- Computed : true ,
337- AtLeastOneOf : addonsConfigKeys ,
338- MaxItems : 1 ,
339- Description : `Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. Defaults to disabled; set enabled = true to enable.` ,
340- Elem : & schema.Resource {
341- Schema : map [string ]* schema.Schema {
342- "enabled" : {
343- Type : schema .TypeBool ,
344- Required : true ,
345- },
346- },
347- },
348- },
349349 "kalm_config" : {
350350 Type : schema .TypeList ,
351351 Optional : true ,
@@ -3100,6 +3100,14 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig {
31003100 }
31013101 }
31023102
3103+ if v , ok := config ["gce_persistent_disk_csi_driver_config" ]; ok && len (v .([]interface {})) > 0 {
3104+ addon := v .([]interface {})[0 ].(map [string ]interface {})
3105+ ac .GcePersistentDiskCsiDriverConfig = & container.GcePersistentDiskCsiDriverConfig {
3106+ Enabled : addon ["enabled" ].(bool ),
3107+ ForceSendFields : []string {"Enabled" },
3108+ }
3109+ }
3110+
31033111 if v , ok := config ["istio_config" ]; ok && len (v .([]interface {})) > 0 {
31043112 addon := v .([]interface {})[0 ].(map [string ]interface {})
31053113 ac .IstioConfig = & container.IstioConfig {
@@ -3109,14 +3117,6 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig {
31093117 }
31103118 }
31113119
3112- if v , ok := config ["gce_persistent_disk_csi_driver_config" ]; ok && len (v .([]interface {})) > 0 {
3113- addon := v .([]interface {})[0 ].(map [string ]interface {})
3114- ac .GcePersistentDiskCsiDriverConfig = & container.GcePersistentDiskCsiDriverConfig {
3115- Enabled : addon ["enabled" ].(bool ),
3116- ForceSendFields : []string {"Enabled" },
3117- }
3118- }
3119-
31203120 if v , ok := config ["kalm_config" ]; ok && len (v .([]interface {})) > 0 {
31213121 addon := v .([]interface {})[0 ].(map [string ]interface {})
31223122 ac .KalmConfig = & container.KalmConfig {
@@ -3779,19 +3779,19 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac
37793779 }
37803780 }
37813781
3782- if c .IstioConfig != nil {
3783- result ["istio_config " ] = []map [string ]interface {}{
3782+ if c .GcePersistentDiskCsiDriverConfig != nil {
3783+ result ["gce_persistent_disk_csi_driver_config " ] = []map [string ]interface {}{
37843784 {
3785- "disabled" : c .IstioConfig .Disabled ,
3786- "auth" : c .IstioConfig .Auth ,
3785+ "enabled" : c .GcePersistentDiskCsiDriverConfig .Enabled ,
37873786 },
37883787 }
37893788 }
37903789
3791- if c .GcePersistentDiskCsiDriverConfig != nil {
3792- result ["gce_persistent_disk_csi_driver_config " ] = []map [string ]interface {}{
3790+ if c .IstioConfig != nil {
3791+ result ["istio_config " ] = []map [string ]interface {}{
37933792 {
3794- "enabled" : c .GcePersistentDiskCsiDriverConfig .Enabled ,
3793+ "disabled" : c .IstioConfig .Disabled ,
3794+ "auth" : c .IstioConfig .Auth ,
37953795 },
37963796 }
37973797 }
0 commit comments