From 8504a764118d6fcb463e291f721903d629a29ab4 Mon Sep 17 00:00:00 2001 From: drunkirishcoder Date: Thu, 27 Jan 2022 18:48:11 -0500 Subject: [PATCH 1/3] fix nodegroup minsize and desiredsize --- CHANGELOG.md | 2 ++ nodejs/eks/nodegroup.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a17628d9e..4538b9241 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## Unreleased - Fix `ENABLE_PREFIX_DELEGATION` not working [#646](https://github.com/pulumi/pulumi-eks/pull/646) +- Fix node group's `minSize` and `desiredSize` cannot be 0 + [#645](https://github.com/pulumi/pulumi-eks/issues/645) ## 0.36.0 (Released December 3, 2021) - Add support for all EC2 LaunchConfiguration EBS parameters related to cluster root node volumes diff --git a/nodejs/eks/nodegroup.ts b/nodejs/eks/nodegroup.ts index eeb2cea98..24915d253 100644 --- a/nodejs/eks/nodegroup.ts +++ b/nodejs/eks/nodegroup.ts @@ -904,8 +904,8 @@ export function createManagedNodeGroup(name: string, args: ManagedNodeGroupOptio scalingConfig: pulumi.all([ args.scalingConfig, ]).apply(([config]) => { - const desiredSize = config && config.desiredSize || 2; - const minSize = config && config.minSize || 1; + const desiredSize = config && config.desiredSize !== undefined ? config.desiredSize : 2; + const minSize = config && config.minSize !== undefined ? config.minSzie : 1; const maxSize = config && config.maxSize || 2; return { desiredSize: desiredSize, From 9f8091ab18f8b6bee4a265e320382fd2082eef09 Mon Sep 17 00:00:00 2001 From: Daniel Jin Date: Fri, 4 Feb 2022 10:46:41 -0500 Subject: [PATCH 2/3] more idiomatic ts code Co-authored-by: Charles Tison --- nodejs/eks/nodegroup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodejs/eks/nodegroup.ts b/nodejs/eks/nodegroup.ts index 24915d253..b314f08e2 100644 --- a/nodejs/eks/nodegroup.ts +++ b/nodejs/eks/nodegroup.ts @@ -904,8 +904,8 @@ export function createManagedNodeGroup(name: string, args: ManagedNodeGroupOptio scalingConfig: pulumi.all([ args.scalingConfig, ]).apply(([config]) => { - const desiredSize = config && config.desiredSize !== undefined ? config.desiredSize : 2; - const minSize = config && config.minSize !== undefined ? config.minSzie : 1; + const desiredSize = config?.desiredSize ?? 2; + const minSize = config?.minSize ?? 1; const maxSize = config && config.maxSize || 2; return { desiredSize: desiredSize, From 22dea59581bcfd726b07222c2e680bc284441728 Mon Sep 17 00:00:00 2001 From: drunkirishcoder Date: Fri, 4 Feb 2022 10:50:04 -0500 Subject: [PATCH 3/3] one more fix --- nodejs/eks/nodegroup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs/eks/nodegroup.ts b/nodejs/eks/nodegroup.ts index b314f08e2..420946675 100644 --- a/nodejs/eks/nodegroup.ts +++ b/nodejs/eks/nodegroup.ts @@ -906,7 +906,7 @@ export function createManagedNodeGroup(name: string, args: ManagedNodeGroupOptio ]).apply(([config]) => { const desiredSize = config?.desiredSize ?? 2; const minSize = config?.minSize ?? 1; - const maxSize = config && config.maxSize || 2; + const maxSize = config?.maxSize ?? 2; return { desiredSize: desiredSize, minSize: minSize,