From f4c1af2a544ac426ecad44525bca5a34713c40a5 Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Fri, 13 Sep 2024 09:37:53 -0700 Subject: [PATCH] fix: no gcfs block when enable_gcfs null (#2093) --- autogen/main/cluster.tf.tmpl | 2 +- cluster.tf | 2 +- modules/beta-private-cluster-update-variant/cluster.tf | 2 +- modules/beta-private-cluster/cluster.tf | 2 +- modules/beta-public-cluster-update-variant/cluster.tf | 2 +- modules/beta-public-cluster/cluster.tf | 2 +- modules/private-cluster-update-variant/cluster.tf | 2 +- modules/private-cluster/cluster.tf | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 901de66ef9..4423f2d694 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -516,7 +516,7 @@ resource "google_container_cluster" "primary" { min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "") enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false) dynamic "gcfs_config" { - for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : [false] + for_each = lookup(var.node_pools[0], "enable_gcfs", null) != null ? [var.node_pools[0]] : [] content { enabled = gcfs_config.value } diff --git a/cluster.tf b/cluster.tf index ea7c585825..9304059307 100644 --- a/cluster.tf +++ b/cluster.tf @@ -393,7 +393,7 @@ resource "google_container_cluster" "primary" { min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "") enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false) dynamic "gcfs_config" { - for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : [false] + for_each = lookup(var.node_pools[0], "enable_gcfs", null) != null ? [var.node_pools[0]] : [] content { enabled = gcfs_config.value } diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index 804ee52f5f..ff77b6211f 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -439,7 +439,7 @@ resource "google_container_cluster" "primary" { min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "") enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false) dynamic "gcfs_config" { - for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : [false] + for_each = lookup(var.node_pools[0], "enable_gcfs", null) != null ? [var.node_pools[0]] : [] content { enabled = gcfs_config.value } diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index 4173d35c5f..a514da0e14 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -439,7 +439,7 @@ resource "google_container_cluster" "primary" { min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "") enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false) dynamic "gcfs_config" { - for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : [false] + for_each = lookup(var.node_pools[0], "enable_gcfs", null) != null ? [var.node_pools[0]] : [] content { enabled = gcfs_config.value } diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index f12231cfb3..98c1685321 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -439,7 +439,7 @@ resource "google_container_cluster" "primary" { min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "") enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false) dynamic "gcfs_config" { - for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : [false] + for_each = lookup(var.node_pools[0], "enable_gcfs", null) != null ? [var.node_pools[0]] : [] content { enabled = gcfs_config.value } diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index 163903870c..1010467a93 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -439,7 +439,7 @@ resource "google_container_cluster" "primary" { min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "") enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false) dynamic "gcfs_config" { - for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : [false] + for_each = lookup(var.node_pools[0], "enable_gcfs", null) != null ? [var.node_pools[0]] : [] content { enabled = gcfs_config.value } diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 2378b2ba2b..228b1ed12f 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -393,7 +393,7 @@ resource "google_container_cluster" "primary" { min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "") enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false) dynamic "gcfs_config" { - for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : [false] + for_each = lookup(var.node_pools[0], "enable_gcfs", null) != null ? [var.node_pools[0]] : [] content { enabled = gcfs_config.value } diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index bd45bf41fd..a6079069c2 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -393,7 +393,7 @@ resource "google_container_cluster" "primary" { min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "") enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false) dynamic "gcfs_config" { - for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : [false] + for_each = lookup(var.node_pools[0], "enable_gcfs", null) != null ? [var.node_pools[0]] : [] content { enabled = gcfs_config.value }