From 151c8c4fb3e62fe91762e7b2f7d97f7581b48024 Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Mon, 18 Apr 2022 10:08:33 -0700 Subject: [PATCH] fix: set initial_node_count with remove_default_node_pool (#1228) --- autogen/safer-cluster/main.tf.tmpl | 4 ++-- modules/safer-cluster-update-variant/main.tf | 4 ++-- modules/safer-cluster/main.tf | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autogen/safer-cluster/main.tf.tmpl b/autogen/safer-cluster/main.tf.tmpl index 380199b7da..adc37d5fea 100644 --- a/autogen/safer-cluster/main.tf.tmpl +++ b/autogen/safer-cluster/main.tf.tmpl @@ -77,11 +77,11 @@ module "gke" { maintenance_start_time = var.maintenance_start_time - initial_node_count = var.initial_node_count - // We suggest removing the default node pool, as it cannot be modified without // destroying the cluster. remove_default_node_pool = true + // If removing the default node pool, initial_node_count should be at least 1. + initial_node_count = (var.initial_node_count == 0) ? 1 : var.initial_node_count node_pools = var.node_pools node_pools_labels = var.node_pools_labels diff --git a/modules/safer-cluster-update-variant/main.tf b/modules/safer-cluster-update-variant/main.tf index 26175c802b..7284601e45 100644 --- a/modules/safer-cluster-update-variant/main.tf +++ b/modules/safer-cluster-update-variant/main.tf @@ -73,11 +73,11 @@ module "gke" { maintenance_start_time = var.maintenance_start_time - initial_node_count = var.initial_node_count - // We suggest removing the default node pool, as it cannot be modified without // destroying the cluster. remove_default_node_pool = true + // If removing the default node pool, initial_node_count should be at least 1. + initial_node_count = (var.initial_node_count == 0) ? 1 : var.initial_node_count node_pools = var.node_pools node_pools_labels = var.node_pools_labels diff --git a/modules/safer-cluster/main.tf b/modules/safer-cluster/main.tf index b1b497f790..8bc07bce0b 100644 --- a/modules/safer-cluster/main.tf +++ b/modules/safer-cluster/main.tf @@ -73,11 +73,11 @@ module "gke" { maintenance_start_time = var.maintenance_start_time - initial_node_count = var.initial_node_count - // We suggest removing the default node pool, as it cannot be modified without // destroying the cluster. remove_default_node_pool = true + // If removing the default node pool, initial_node_count should be at least 1. + initial_node_count = (var.initial_node_count == 0) ? 1 : var.initial_node_count node_pools = var.node_pools node_pools_labels = var.node_pools_labels