@@ -1041,22 +1041,22 @@ var _ = ginkgo.Describe("LeaderWorkerSet controller", func() {
10411041 // Rolling update index-1 replica.
10421042 lwsUpdateFn : func (lws * leaderworkerset.LeaderWorkerSet ) {
10431043 testing .SetPodGroupToReady (ctx , k8sClient , lws .Name + "-1" , lws )
1044- // Reclaim the replica.
1045- testing .DeleteLeaderPod (ctx , k8sClient , lws , 4 , 5 )
10461044 },
10471045 checkLWSState : func (lws * leaderworkerset.LeaderWorkerSet ) {
1048- testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 4 )
1046+ testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 5 )
10491047 testing .ExpectLeaderWorkerSetUnavailable (ctx , k8sClient , lws , "All replicas are ready" )
10501048 testing .ExpectLeaderWorkerSetProgressing (ctx , k8sClient , lws , "Replicas are progressing" )
10511049 testing .ExpectLeaderWorkerSetUpgradeInProgress (ctx , k8sClient , lws , "Rolling Upgrade is in progress" )
10521050 testing .ExpectStatefulsetPartitionEqualTo (ctx , k8sClient , lws , 0 )
1053- testing .ExpectLeaderWorkerSetStatusReplicas (ctx , k8sClient , lws , 4 , 3 )
1051+ testing .ExpectLeaderWorkerSetStatusReplicas (ctx , k8sClient , lws , 5 , 4 )
10541052 },
10551053 },
10561054 {
10571055 // Rolling update index-0 replica.
10581056 lwsUpdateFn : func (lws * leaderworkerset.LeaderWorkerSet ) {
10591057 testing .SetPodGroupToReady (ctx , k8sClient , lws .Name + "-0" , lws )
1058+ // Reclaim the replica.
1059+ testing .DeleteLeaderPod (ctx , k8sClient , lws , 4 , 5 )
10601060 },
10611061 checkLWSState : func (lws * leaderworkerset.LeaderWorkerSet ) {
10621062 testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 4 )
@@ -1238,10 +1238,10 @@ var _ = ginkgo.Describe("LeaderWorkerSet controller", func() {
12381238 var leaderSts appsv1.StatefulSet
12391239 testing .GetLeaderStatefulset (ctx , lws , k8sClient , & leaderSts )
12401240 // Create leader pod for maxSurge.
1241- gomega .Expect (testing .CreateLeaderPods (ctx , leaderSts , k8sClient , lws , 2 , 3 )).To (gomega .Succeed ())
1241+ gomega .Expect (testing .CreateLeaderPods (ctx , leaderSts , k8sClient , lws , 2 , 4 )).To (gomega .Succeed ())
12421242 },
12431243 checkLWSState : func (lws * leaderworkerset.LeaderWorkerSet ) {
1244- testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 3 )
1244+ testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 4 )
12451245 testing .ExpectLeaderWorkerSetUnavailable (ctx , k8sClient , lws , "All replicas are ready" )
12461246 testing .ExpectLeaderWorkerSetProgressing (ctx , k8sClient , lws , "Replicas are progressing" )
12471247 testing .ExpectLeaderWorkerSetUpgradeInProgress (ctx , k8sClient , lws , "Rolling Upgrade is in progress" )
@@ -1251,7 +1251,7 @@ var _ = ginkgo.Describe("LeaderWorkerSet controller", func() {
12511251 {
12521252 // Set all groups to ready.
12531253 lwsUpdateFn : func (lws * leaderworkerset.LeaderWorkerSet ) {
1254- testing .SetPodGroupsToReady (ctx , k8sClient , lws , 3 )
1254+ testing .SetPodGroupsToReady (ctx , k8sClient , lws , 4 )
12551255 },
12561256 checkLWSState : func (lws * leaderworkerset.LeaderWorkerSet ) {
12571257 testing .ExpectLeaderWorkerSetAvailable (ctx , k8sClient , lws , "All replicas are ready" )
@@ -1373,52 +1373,55 @@ var _ = ginkgo.Describe("LeaderWorkerSet controller", func() {
13731373 return k8sClient .Update (ctx , & leaderworkerset )
13741374 }, testing .Timeout , testing .Interval ).Should (gomega .Succeed ())
13751375 testing .DeleteLeaderPod (ctx , k8sClient , lws , 4 , 8 )
1376- // Reclaim the last replica.
1377- testing .DeleteLeaderPod (ctx , k8sClient , lws , 3 , 4 )
13781376 },
13791377 checkLWSState : func (lws * leaderworkerset.LeaderWorkerSet ) {
1380- testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 3 )
1378+ testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 4 )
13811379 testing .ExpectLeaderWorkerSetUnavailable (ctx , k8sClient , lws , "All replicas are ready" )
13821380 testing .ExpectLeaderWorkerSetProgressing (ctx , k8sClient , lws , "Replicas are progressing" )
13831381 testing .ExpectLeaderWorkerSetUpgradeInProgress (ctx , k8sClient , lws , "Rolling Upgrade is in progress" )
13841382 testing .ExpectStatefulsetPartitionEqualTo (ctx , k8sClient , lws , 1 )
1385- testing .ExpectLeaderWorkerSetStatusReplicas (ctx , k8sClient , lws , 3 , 0 )
1383+ testing .ExpectLeaderWorkerSetStatusReplicas (ctx , k8sClient , lws , 4 , 0 )
13861384 },
13871385 },
13881386 {
13891387 // Rolling update index-2 replica.
13901388 lwsUpdateFn : func (lws * leaderworkerset.LeaderWorkerSet ) {
13911389 testing .SetPodGroupToReady (ctx , k8sClient , lws .Name + "-2" , lws )
1390+ testing .SetPodGroupToReady (ctx , k8sClient , lws .Name + "-3" , lws )
1391+ // Reclaim the last replica.
1392+ // testing.DeleteLeaderPod(ctx, k8sClient, lws, 3, 4)
13921393 },
13931394 checkLWSState : func (lws * leaderworkerset.LeaderWorkerSet ) {
1394- testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 3 )
1395+ testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 4 )
13951396 testing .ExpectLeaderWorkerSetUnavailable (ctx , k8sClient , lws , "All replicas are ready" )
13961397 testing .ExpectLeaderWorkerSetProgressing (ctx , k8sClient , lws , "Replicas are progressing" )
13971398 testing .ExpectLeaderWorkerSetUpgradeInProgress (ctx , k8sClient , lws , "Rolling Upgrade is in progress" )
13981399 testing .ExpectStatefulsetPartitionEqualTo (ctx , k8sClient , lws , 0 )
1399- testing .ExpectLeaderWorkerSetStatusReplicas (ctx , k8sClient , lws , 3 , 1 )
1400+ testing .ExpectLeaderWorkerSetStatusReplicas (ctx , k8sClient , lws , 4 , 2 )
14001401 },
14011402 },
14021403 {
14031404 // Rolling update index-1 replica.
14041405 lwsUpdateFn : func (lws * leaderworkerset.LeaderWorkerSet ) {
14051406 testing .SetPodGroupToReady (ctx , k8sClient , lws .Name + "-1" , lws )
14061407 // Reclaim the last replica.
1407- testing .DeleteLeaderPod (ctx , k8sClient , lws , 2 , 3 )
1408+ testing .DeleteLeaderPod (ctx , k8sClient , lws , 3 , 4 )
14081409 },
14091410 checkLWSState : func (lws * leaderworkerset.LeaderWorkerSet ) {
1410- testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 2 )
1411+ testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 3 )
14111412 testing .ExpectLeaderWorkerSetUnavailable (ctx , k8sClient , lws , "All replicas are ready" )
14121413 testing .ExpectLeaderWorkerSetProgressing (ctx , k8sClient , lws , "Replicas are progressing" )
14131414 testing .ExpectLeaderWorkerSetUpgradeInProgress (ctx , k8sClient , lws , "Rolling Upgrade is in progress" )
14141415 testing .ExpectStatefulsetPartitionEqualTo (ctx , k8sClient , lws , 0 )
1415- testing .ExpectLeaderWorkerSetStatusReplicas (ctx , k8sClient , lws , 2 , 1 )
1416+ testing .ExpectLeaderWorkerSetStatusReplicas (ctx , k8sClient , lws , 3 , 2 )
14161417 },
14171418 },
14181419 {
14191420 // Rolling update index-0 replica.
14201421 lwsUpdateFn : func (lws * leaderworkerset.LeaderWorkerSet ) {
14211422 testing .SetPodGroupToReady (ctx , k8sClient , lws .Name + "-0" , lws )
1423+ // Reclaim the last replica.
1424+ testing .DeleteLeaderPod (ctx , k8sClient , lws , 2 , 3 )
14221425 },
14231426 checkLWSState : func (lws * leaderworkerset.LeaderWorkerSet ) {
14241427 testing .ExpectValidLeaderStatefulSet (ctx , k8sClient , lws , 2 )
0 commit comments