From 72dc20a3541ddba9202ad6d5c1847818a12e13e7 Mon Sep 17 00:00:00 2001 From: GokceGK <161626272+GokceGK@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:10:57 +0200 Subject: [PATCH] add maxUnavailable to utils (#479) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gökçe Gök Klingel --- internal/pkg/services/ske/utils/utils.go | 10 ++++++---- internal/pkg/services/ske/utils/utils_test.go | 9 +++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/pkg/services/ske/utils/utils.go b/internal/pkg/services/ske/utils/utils.go index 8af23411..1ce6c897 100644 --- a/internal/pkg/services/ske/utils/utils.go +++ b/internal/pkg/services/ske/utils/utils.go @@ -21,6 +21,7 @@ const ( defaultNodepoolMachineType = "b1.2" defaultNodepoolMachineImageName = "flatcar" defaultNodepoolMaxSurge = 1 + defaultNodepoolMaxUnavailable = 0 defaultNodepoolMaximum = 2 defaultNodepoolMinimum = 1 defaultNodepoolName = "pool-default" @@ -138,10 +139,11 @@ func getDefaultPayloadNodepool(resp *ske.ProviderOptions) (*ske.Nodepool, error) Name: utils.Ptr(defaultNodepoolMachineImageName), }, }, - MaxSurge: utils.Ptr(int64(defaultNodepoolMaxSurge)), - Maximum: utils.Ptr(int64(defaultNodepoolMaximum)), - Minimum: utils.Ptr(int64(defaultNodepoolMinimum)), - Name: utils.Ptr(defaultNodepoolName), + MaxSurge: utils.Ptr(int64(defaultNodepoolMaxSurge)), + MaxUnavailable: utils.Ptr(int64(defaultNodepoolMaxUnavailable)), + Maximum: utils.Ptr(int64(defaultNodepoolMaximum)), + Minimum: utils.Ptr(int64(defaultNodepoolMinimum)), + Name: utils.Ptr(defaultNodepoolName), Volume: &ske.Volume{ Type: utils.Ptr(defaultNodepoolVolumeType), Size: utils.Ptr(int64(defaultNodepoolVolumeSize)), diff --git a/internal/pkg/services/ske/utils/utils_test.go b/internal/pkg/services/ske/utils/utils_test.go index bcf8139b..55331155 100644 --- a/internal/pkg/services/ske/utils/utils_test.go +++ b/internal/pkg/services/ske/utils/utils_test.go @@ -312,10 +312,11 @@ func fixtureGetDefaultPayload(mods ...func(*ske.CreateOrUpdateClusterPayload)) * Name: utils.Ptr("flatcar"), }, }, - MaxSurge: utils.Ptr(int64(1)), - Maximum: utils.Ptr(int64(2)), - Minimum: utils.Ptr(int64(1)), - Name: utils.Ptr("pool-default"), + MaxSurge: utils.Ptr(int64(1)), + MaxUnavailable: utils.Ptr(int64(0)), + Maximum: utils.Ptr(int64(2)), + Minimum: utils.Ptr(int64(1)), + Name: utils.Ptr("pool-default"), Volume: &ske.Volume{ Type: utils.Ptr("storage_premium_perf2"), Size: utils.Ptr(int64(50)),