Skip to content

Commit 3dd9a10

Browse files
Address comments
1 parent 35d0209 commit 3dd9a10

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

internal/controllers/machinedeployment/machinedeployment_rollout_rollingupdate_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,16 +464,15 @@ func Test_reconcileOldMachineSetsRollingUpdate(t *testing.T) {
464464
expectedNotes: map[string][]string{},
465465
},
466466
{
467-
name: "do not scale down if there are unavailable replicas on the new MachineSet (maxSurge 1, maxUnavailable 9), all machines unavailable",
467+
name: "do not scale down if there are unavailable replicas on the new MachineSet (maxSurge 1, maxUnavailable 0), all machines unavailable",
468468
scaleIntent: map[string]int32{},
469469
md: createMD("v2", 3, withRollingUpdateStrategy(1, 0)),
470470
newMS: createMS("ms2", "v2", 1, withStatusReplicas(1), withStatusAvailableReplicas(0)), // one machine created on the new NewMS due to maxSurge, but it is not reaching the available state,
471471
oldMSs: []*clusterv1.MachineSet{
472-
createMS("ms1", "v1", 2, withStatusReplicas(3), withStatusAvailableReplicas(0)), // OldMS has unavailable replicas
472+
createMS("ms1", "v1", 3, withStatusReplicas(3), withStatusAvailableReplicas(0)),
473473
},
474474
expectScaleIntent: map[string]int32{
475-
// no new scale down intent for oldMSs (ms1):
476-
// 3 available replicas from ms1 - 1 replica already scaling down from ms1 + 3 available replica from ms2 = 5 available replicas == minAvailability, we cannot further scale down
475+
// no new scale down intent for oldMSs (ms1): unavailability on new MS
477476
},
478477
expectedNotes: map[string][]string{},
479478
skipMaxUnavailabilityCheck: true, // The test case is simulating all machines not unavailable, so this check will fail
@@ -487,8 +486,7 @@ func Test_reconcileOldMachineSetsRollingUpdate(t *testing.T) {
487486
createMS("ms1", "v1", 2, withStatusReplicas(2), withStatusAvailableReplicas(0)), // OldMS scaled down due to maxUnavailable 1
488487
},
489488
expectScaleIntent: map[string]int32{
490-
// no new scale down intent for oldMSs (ms1):
491-
// 3 available replicas from ms1 - 1 replica already scaling down from ms1 + 3 available replica from ms2 = 5 available replicas == minAvailability, we cannot further scale down
489+
// no new scale down intent for oldMSs (ms1): unavailability on new MS
492490
},
493491
expectedNotes: map[string][]string{},
494492
skipMaxUnavailabilityCheck: true, // The test case is simulating all machines not unavailable, so this check will fail

0 commit comments

Comments
 (0)