Skip to content

Commit

Permalink
add maxUnavailable to utils (#479)
Browse files Browse the repository at this point in the history
Co-authored-by: Gökçe Gök Klingel <[email protected]>
  • Loading branch information
GokceGK and GokceGK authored Sep 13, 2024
1 parent 425a9a2 commit 72dc20a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 6 additions & 4 deletions internal/pkg/services/ske/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (
defaultNodepoolMachineType = "b1.2"
defaultNodepoolMachineImageName = "flatcar"
defaultNodepoolMaxSurge = 1
defaultNodepoolMaxUnavailable = 0
defaultNodepoolMaximum = 2
defaultNodepoolMinimum = 1
defaultNodepoolName = "pool-default"
Expand Down Expand Up @@ -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)),
Expand Down
9 changes: 5 additions & 4 deletions internal/pkg/services/ske/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit 72dc20a

Please sign in to comment.