Skip to content

Commit b39e73a

Browse files
Move cloudrun_config from beta to GA, fix doc. (#3470) (#2037)
Signed-off-by: Modular Magician <[email protected]>
1 parent 51f2b5b commit b39e73a

File tree

4 files changed

+35
-32
lines changed

4 files changed

+35
-32
lines changed

.changelog/3470.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
container: Moved `google_container_cluster.addons_config.cloudrun_config` from beta to GA.
3+
```

google-beta/resource_container_cluster.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ var (
5353
"addons_config.0.http_load_balancing",
5454
"addons_config.0.horizontal_pod_autoscaling",
5555
"addons_config.0.network_policy_config",
56-
"addons_config.0.istio_config",
5756
"addons_config.0.cloudrun_config",
57+
"addons_config.0.istio_config",
5858
"addons_config.0.dns_cache_config",
5959
"addons_config.0.gce_persistent_disk_csi_driver_config",
6060
"addons_config.0.kalm_config",
@@ -236,7 +236,7 @@ func resourceContainerCluster() *schema.Resource {
236236
},
237237
},
238238
},
239-
"istio_config": {
239+
"cloudrun_config": {
240240
Type: schema.TypeList,
241241
Optional: true,
242242
Computed: true,
@@ -248,17 +248,10 @@ func resourceContainerCluster() *schema.Resource {
248248
Type: schema.TypeBool,
249249
Required: true,
250250
},
251-
"auth": {
252-
Type: schema.TypeString,
253-
Optional: true,
254-
// We can't use a Terraform-level default because it won't be true when the block is disabled: true
255-
DiffSuppressFunc: emptyOrDefaultStringSuppress("AUTH_NONE"),
256-
ValidateFunc: validation.StringInSlice([]string{"AUTH_NONE", "AUTH_MUTUAL_TLS"}, false),
257-
},
258251
},
259252
},
260253
},
261-
"cloudrun_config": {
254+
"istio_config": {
262255
Type: schema.TypeList,
263256
Optional: true,
264257
Computed: true,
@@ -270,6 +263,13 @@ func resourceContainerCluster() *schema.Resource {
270263
Type: schema.TypeBool,
271264
Required: true,
272265
},
266+
"auth": {
267+
Type: schema.TypeString,
268+
Optional: true,
269+
// We can't use a Terraform-level default because it won't be true when the block is disabled: true
270+
DiffSuppressFunc: emptyOrDefaultStringSuppress("AUTH_NONE"),
271+
ValidateFunc: validation.StringInSlice([]string{"AUTH_NONE", "AUTH_MUTUAL_TLS"}, false),
272+
},
273273
},
274274
},
275275
},
@@ -2195,19 +2195,19 @@ func expandClusterAddonsConfig(configured interface{}) *containerBeta.AddonsConf
21952195
}
21962196
}
21972197

2198-
if v, ok := config["istio_config"]; ok && len(v.([]interface{})) > 0 {
2198+
if v, ok := config["cloudrun_config"]; ok && len(v.([]interface{})) > 0 {
21992199
addon := v.([]interface{})[0].(map[string]interface{})
2200-
ac.IstioConfig = &containerBeta.IstioConfig{
2200+
ac.CloudRunConfig = &containerBeta.CloudRunConfig{
22012201
Disabled: addon["disabled"].(bool),
2202-
Auth: addon["auth"].(string),
22032202
ForceSendFields: []string{"Disabled"},
22042203
}
22052204
}
22062205

2207-
if v, ok := config["cloudrun_config"]; ok && len(v.([]interface{})) > 0 {
2206+
if v, ok := config["istio_config"]; ok && len(v.([]interface{})) > 0 {
22082207
addon := v.([]interface{})[0].(map[string]interface{})
2209-
ac.CloudRunConfig = &containerBeta.CloudRunConfig{
2208+
ac.IstioConfig = &containerBeta.IstioConfig{
22102209
Disabled: addon["disabled"].(bool),
2210+
Auth: addon["auth"].(string),
22112211
ForceSendFields: []string{"Disabled"},
22122212
}
22132213
}
@@ -2616,19 +2616,19 @@ func flattenClusterAddonsConfig(c *containerBeta.AddonsConfig) []map[string]inte
26162616
}
26172617
}
26182618

2619-
if c.IstioConfig != nil {
2620-
result["istio_config"] = []map[string]interface{}{
2619+
if c.CloudRunConfig != nil {
2620+
result["cloudrun_config"] = []map[string]interface{}{
26212621
{
2622-
"disabled": c.IstioConfig.Disabled,
2623-
"auth": c.IstioConfig.Auth,
2622+
"disabled": c.CloudRunConfig.Disabled,
26242623
},
26252624
}
26262625
}
26272626

2628-
if c.CloudRunConfig != nil {
2629-
result["cloudrun_config"] = []map[string]interface{}{
2627+
if c.IstioConfig != nil {
2628+
result["istio_config"] = []map[string]interface{}{
26302629
{
2631-
"disabled": c.CloudRunConfig.Disabled,
2630+
"disabled": c.IstioConfig.Disabled,
2631+
"auth": c.IstioConfig.Auth,
26322632
},
26332633
}
26342634
}

google-beta/resource_container_cluster_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,12 +1962,12 @@ resource "google_container_cluster" "primary" {
19621962
network_policy_config {
19631963
disabled = true
19641964
}
1965-
istio_config {
1965+
cloudrun_config {
19661966
disabled = true
1967-
auth = "AUTH_MUTUAL_TLS"
19681967
}
1969-
cloudrun_config {
1968+
istio_config {
19701969
disabled = true
1970+
auth = "AUTH_MUTUAL_TLS"
19711971
}
19721972
dns_cache_config {
19731973
enabled = false
@@ -2002,12 +2002,12 @@ resource "google_container_cluster" "primary" {
20022002
network_policy_config {
20032003
disabled = false
20042004
}
2005-
istio_config {
2005+
cloudrun_config {
20062006
disabled = false
2007-
auth = "AUTH_NONE"
20082007
}
2009-
cloudrun_config {
2008+
istio_config {
20102009
disabled = false
2010+
auth = "AUTH_NONE"
20112011
}
20122012
dns_cache_config {
20132013
enabled = true

website/docs/r/container_cluster.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,13 @@ The `addons_config` block supports:
321321
It can only be disabled if the nodes already do not have network policies enabled.
322322
Defaults to disabled; set `disabled = false` to enable.
323323

324+
* `cloudrun_config` - (Optional).
325+
The status of the CloudRun addon. It is disabled by default.
326+
Set `disabled = false` to enable.
327+
324328
* `istio_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)).
325329
Structure is documented below.
326330

327-
* `cloudrun_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)).
328-
The status of the CloudRun addon. It requires `istio_config` enabled. It is disabled by default.
329-
Set `disabled = false` to enable. This addon can only be enabled at cluster creation time.
330-
331331
* `dns_cache_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)).
332332
The status of the NodeLocal DNSCache addon. It is disabled by default.
333333
Set `enabled = true` to enable.

0 commit comments

Comments
 (0)