Skip to content

Commit ec42a18

Browse files
authored
fix: gcfs AP diff and general cleanup (terraform-google-modules#2043)
1 parent a83100d commit ec42a18

File tree

14 files changed

+34
-22
lines changed

14 files changed

+34
-22
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,9 @@ resource "google_container_cluster" "primary" {
364364

365365
dynamic "ray_operator_config" {
366366
for_each = local.ray_operator_config
367-
367+
368368
content {
369-
369+
370370
enabled = ray_operator_config.value.enabled
371371

372372
ray_cluster_logging_config {
@@ -480,6 +480,11 @@ resource "google_container_cluster" "primary" {
480480
ignore_changes = [node_pool, initial_node_count, resource_labels["asmv"]]
481481
}
482482
{% endif %}
483+
{% if autopilot_cluster == true %}
484+
lifecycle {
485+
ignore_changes = [node_pool_defaults[0].node_config_defaults[0].gcfs_config[0].enabled]
486+
}
487+
{% endif %}
483488

484489
{% if autopilot_cluster != true %}
485490
dynamic "dns_config" {
@@ -660,21 +665,18 @@ resource "google_container_cluster" "primary" {
660665
}
661666
}
662667
}
663-
{% if beta_cluster and autopilot_cluster != true %}
668+
{% if beta_cluster %}
664669

665670
node_pool_defaults {
666671
node_config_defaults {
672+
{% if autopilot_cluster %}
673+
logging_variant = var.logging_variant
674+
{% endif %}
675+
{% if autopilot_cluster != true %}
667676
gcfs_config {
668677
enabled = var.enable_gcfs
669678
}
670-
}
671-
}
672-
{% endif %}
673-
{% if beta_cluster and autopilot_cluster %}
674-
675-
node_pool_defaults {
676-
node_config_defaults {
677-
logging_variant = var.logging_variant
679+
{% endif %}
678680
}
679681
}
680682
{% endif %}

autogen/main/variables.tf.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,13 +818,13 @@ variable "ray_operator_config" {
818818
type = object({
819819
enabled = bool
820820
logging_enabled = optional(bool, false)
821-
monitoring_enabled = optional(bool, false)
821+
monitoring_enabled = optional(bool, false)
822822
})
823823
description = "The Ray Operator Addon configuration for this cluster."
824824
default = {
825825
enabled = false
826826
logging_enabled = false
827-
monitoring_enabled = false
827+
monitoring_enabled = false
828828
}
829829
}
830830

@@ -944,7 +944,7 @@ variable "sandbox_enabled" {
944944

945945
variable "enable_gcfs" {
946946
type = bool
947-
description = "Enable image streaming on cluster level."
947+
description = "(Beta) Enable image streaming on cluster level."
948948
default = false
949949
}
950950
{% endif %}

modules/beta-autopilot-private-cluster/cluster.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ resource "google_container_cluster" "primary" {
261261
}
262262
}
263263

264+
lifecycle {
265+
ignore_changes = [node_pool_defaults[0].node_config_defaults[0].gcfs_config[0].enabled]
266+
}
264267

265268
timeouts {
266269
create = lookup(var.timeouts, "create", "45m")

modules/beta-autopilot-public-cluster/cluster.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ resource "google_container_cluster" "primary" {
261261
}
262262
}
263263

264+
lifecycle {
265+
ignore_changes = [node_pool_defaults[0].node_config_defaults[0].gcfs_config[0].enabled]
266+
}
264267

265268
timeouts {
266269
create = lookup(var.timeouts, "create", "45m")

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Then perform the following commands on the root folder:
203203
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
204204
| enable\_default\_node\_pools\_metadata | Whether to enable the default node pools metadata key-value pairs such as `cluster_name` and `node_pool` | `bool` | `true` | no |
205205
| enable\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
206-
| enable\_gcfs | Enable image streaming on cluster level. | `bool` | `false` | no |
206+
| enable\_gcfs | (Beta) Enable image streaming on cluster level. | `bool` | `false` | no |
207207
| enable\_identity\_service | Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. | `bool` | `false` | no |
208208
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
209209
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ variable "sandbox_enabled" {
902902

903903
variable "enable_gcfs" {
904904
type = bool
905-
description = "Enable image streaming on cluster level."
905+
description = "(Beta) Enable image streaming on cluster level."
906906
default = false
907907
}
908908

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Then perform the following commands on the root folder:
181181
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
182182
| enable\_default\_node\_pools\_metadata | Whether to enable the default node pools metadata key-value pairs such as `cluster_name` and `node_pool` | `bool` | `true` | no |
183183
| enable\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
184-
| enable\_gcfs | Enable image streaming on cluster level. | `bool` | `false` | no |
184+
| enable\_gcfs | (Beta) Enable image streaming on cluster level. | `bool` | `false` | no |
185185
| enable\_identity\_service | Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. | `bool` | `false` | no |
186186
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
187187
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |

modules/beta-private-cluster/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ variable "sandbox_enabled" {
902902

903903
variable "enable_gcfs" {
904904
type = bool
905-
description = "Enable image streaming on cluster level."
905+
description = "(Beta) Enable image streaming on cluster level."
906906
default = false
907907
}
908908

modules/beta-public-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Then perform the following commands on the root folder:
196196
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
197197
| enable\_default\_node\_pools\_metadata | Whether to enable the default node pools metadata key-value pairs such as `cluster_name` and `node_pool` | `bool` | `true` | no |
198198
| enable\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
199-
| enable\_gcfs | Enable image streaming on cluster level. | `bool` | `false` | no |
199+
| enable\_gcfs | (Beta) Enable image streaming on cluster level. | `bool` | `false` | no |
200200
| enable\_identity\_service | Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. | `bool` | `false` | no |
201201
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
202202
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |

modules/beta-public-cluster-update-variant/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ variable "sandbox_enabled" {
866866

867867
variable "enable_gcfs" {
868868
type = bool
869-
description = "Enable image streaming on cluster level."
869+
description = "(Beta) Enable image streaming on cluster level."
870870
default = false
871871
}
872872

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Then perform the following commands on the root folder:
174174
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
175175
| enable\_default\_node\_pools\_metadata | Whether to enable the default node pools metadata key-value pairs such as `cluster_name` and `node_pool` | `bool` | `true` | no |
176176
| enable\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
177-
| enable\_gcfs | Enable image streaming on cluster level. | `bool` | `false` | no |
177+
| enable\_gcfs | (Beta) Enable image streaming on cluster level. | `bool` | `false` | no |
178178
| enable\_identity\_service | Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. | `bool` | `false` | no |
179179
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
180180
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |

modules/beta-public-cluster/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ variable "sandbox_enabled" {
866866

867867
variable "enable_gcfs" {
868868
type = bool
869-
description = "Enable image streaming on cluster level."
869+
description = "(Beta) Enable image streaming on cluster level."
870870
default = false
871871
}
872872

test/integration/simple_autopilot_public/simple_autopiliot_public_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func TestSimpleAutopilotPublic(t *testing.T) {
5656
"addonsConfig.rayOperatorConfig.enabled",
5757
"addonsConfig.rayOperatorConfig.rayClusterLoggingConfig.enabled",
5858
"addonsConfig.rayOperatorConfig.rayClusterMonitoringConfig.enabled",
59+
"nodePoolDefaults.nodeConfigDefaults.gcfsConfig.enabled",
5960
}
6061
for _, pth := range validateJSONPaths {
6162
g.JSONEq(assert, op, pth)

test/integration/simple_autopilot_public/testdata/TestSimpleAutopilotPublic.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@
188188
"variantConfig": {
189189
"variant": "DEFAULT"
190190
}
191+
},
192+
"gcfsConfig": {
193+
"enabled": true
191194
}
192195
}
193196
},

0 commit comments

Comments
 (0)