From da11ef8219d2d86abb8368ae5901aa0367500469 Mon Sep 17 00:00:00 2001 From: Philipp Strube Date: Wed, 16 Aug 2023 18:22:57 +0200 Subject: [PATCH] Fix gcs fuse csi default false to null False causes a rolling update of existing cluster control planes, just because it explicitly sets it to false. Default null prevents that by allowing to make the add-on block conditional. --- google/_modules/gke/cluster.tf | 8 ++++++-- google/cluster/configuration.tf | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/google/_modules/gke/cluster.tf b/google/_modules/gke/cluster.tf index 06af4168..f9d88f2b 100644 --- a/google/_modules/gke/cluster.tf +++ b/google/_modules/gke/cluster.tf @@ -49,8 +49,12 @@ resource "google_container_cluster" "current" { disabled = false } - gcs_fuse_csi_driver_config { - enabled = var.enable_gcs_fuse_csi_driver + dynamic "gcs_fuse_csi_driver_config" { + for_each = var.enable_gcs_fuse_csi_driver != null ? [1] : [] + + content { + enabled = var.enable_gcs_fuse_csi_driver + } } } diff --git a/google/cluster/configuration.tf b/google/cluster/configuration.tf index 0c51a4a3..4095d4f7 100644 --- a/google/cluster/configuration.tf +++ b/google/cluster/configuration.tf @@ -92,5 +92,5 @@ locals { monitoring_config_enable_components_lookup = lookup(local.cfg, "monitoring_config_enable_components", "SYSTEM_COMPONENTS") monitoring_config_enable_components = compact(split(",", local.monitoring_config_enable_components_lookup)) - enable_gcs_fuse_csi_driver = lookup(local.cfg, "enable_gcs_fuse_csi_driver", false) + enable_gcs_fuse_csi_driver = lookup(local.cfg, "enable_gcs_fuse_csi_driver", null) }