@@ -75,6 +75,11 @@ func testCredentialRotation(s *ShootContext, shootVerifiers, utilsverifiers rota
7575 }
7676
7777 ItShouldWaitForShootToBeReconciledAndHealthy (s )
78+
79+ if inPlaceUpdate {
80+ inplace .ItShouldVerifyInPlaceUpdateCompletion (s .GardenClient , s .Shoot )
81+ }
82+
7883 shootVerifiers .AfterPrepared (context .TODO ())
7984 for _ , k := range utilsverifiers {
8085 It (fmt .Sprintf ("Verify after prepared for %T" , k ), func (ctx SpecContext ) {
@@ -122,15 +127,15 @@ func testCredentialRotationComplete(s *ShootContext, shootVerifiers, utilsverifi
122127 }
123128}
124129
125- func testCredentialRotationWithoutWorkersRollout (s * ShootContext , shootVerifiers rotationutils.Verifiers , utilsverifiers rotationutils.Verifiers ) {
130+ func testCredentialRotationWithoutWorkersRollout (s * ShootContext , shootVerifiers rotationutils.Verifiers , utilsverifiers rotationutils.Verifiers , inPlaceUpdate bool ) {
126131 shootVerifiers .Before (context .TODO ())
127132 for _ , k := range utilsverifiers {
128133 It (fmt .Sprintf ("Verify before for %T" , k ), func (ctx SpecContext ) {
129134 k .Before (ctx )
130135 }, SpecTimeout (5 * time .Minute ))
131136 }
132137
133- nodesOfInPlaceWorkersBeforeTest := inplace . ItShouldFindNodesOfInPlaceWorkers (s )
138+ machinePodNamesBeforeTest := ItShouldFindAllMachinePodsBefore (s )
134139
135140 ItShouldAnnotateShoot (s , map [string ]string {
136141 v1beta1constants .GardenerOperation : v1beta1constants .OperationRotateCredentialsStartWithoutWorkersRollout ,
@@ -154,8 +159,7 @@ func testCredentialRotationWithoutWorkersRollout(s *ShootContext, shootVerifiers
154159 }).Should (Succeed ())
155160 }, SpecTimeout (time .Minute ))
156161
157- nodesOfInPlaceWorkersAfterTest := inplace .ItShouldFindNodesOfInPlaceWorkers (s )
158- Expect (nodesOfInPlaceWorkersBeforeTest .UnsortedList ()).To (ConsistOf (nodesOfInPlaceWorkersAfterTest .UnsortedList ()))
162+ ItShouldCompareMachinePodNamesAfter (s , machinePodNamesBeforeTest )
159163
160164 It ("Ensure all worker pools are marked as 'pending for roll out'" , func () {
161165 for _ , worker := range s .Shoot .Spec .Provider .Workers {
@@ -207,8 +211,17 @@ func testCredentialRotationWithoutWorkersRollout(s *ShootContext, shootVerifiers
207211 })).Should (Succeed ())
208212 }, SpecTimeout (time .Minute ))
209213
214+ // In case of rotation without workers rollout, the in-place update status in only populated when the rollout for that worker pool is triggered
215+ if inPlaceUpdate {
216+ inplace .ItShouldVerifyInPlaceUpdateStart (s .GardenClient , s .Shoot , true , true )
217+ }
218+
210219 ItShouldWaitForShootToBeReconciledAndHealthy (s )
211220
221+ if inPlaceUpdate {
222+ inplace .ItShouldVerifyInPlaceUpdateCompletion (s .GardenClient , s .Shoot )
223+ }
224+
212225 It ("Credential rotation in status prepared" , func () {
213226 Expect (s .Shoot .Status .Credentials .Rotation .CertificateAuthorities .Phase ).To (Equal (gardencorev1beta1 .RotationPrepared ))
214227 Expect (s .Shoot .Status .Credentials .Rotation .ServiceAccountKey .Phase ).To (Equal (gardencorev1beta1 .RotationPrepared ))
@@ -323,7 +336,7 @@ var _ = Describe("Shoot Tests", Label("Shoot", "default"), func() {
323336 // test rotation for every rotation type
324337 testCredentialRotation (s , shootVerifiers , utilsVerifiers , v1beta1constants .OperationRotateCredentialsStart , v1beta1constants .OperationRotateCredentialsComplete , inPlaceUpdate )
325338 } else {
326- testCredentialRotationWithoutWorkersRollout (s , shootVerifiers , utilsVerifiers )
339+ testCredentialRotationWithoutWorkersRollout (s , shootVerifiers , utilsVerifiers , inPlaceUpdate )
327340 }
328341
329342 if ! v1beta1helper .IsWorkerless (s .Shoot ) {
@@ -334,7 +347,6 @@ var _ = Describe("Shoot Tests", Label("Shoot", "default"), func() {
334347 if inPlaceUpdate {
335348 nodesOfInPlaceWorkersAfterTest := inplace .ItShouldFindNodesOfInPlaceWorkers (s )
336349 Expect (nodesOfInPlaceWorkersBeforeTest .UnsortedList ()).To (ConsistOf (nodesOfInPlaceWorkersAfterTest .UnsortedList ()))
337- inplace .ItShouldVerifyInPlaceUpdateCompletion (s .GardenClient , s .Shoot )
338350 }
339351 }
340352
@@ -391,6 +403,38 @@ var _ = Describe("Shoot Tests", Label("Shoot", "default"), func() {
391403 test (s , true , false )
392404 })
393405
406+ Context ("without workers rollout, in-place update strategy" , Label ("without-workers-rollout" , "in-place" ), Ordered , func () {
407+ var s * ShootContext
408+ BeforeTestSetup (func () {
409+ shoot := DefaultShoot ("e2e-rot-nr-ip" )
410+
411+ worker1 := DefaultWorker ("auto" , ptr .To (gardencorev1beta1 .AutoInPlaceUpdate ))
412+ worker1 .Minimum = 2
413+ worker1 .Maximum = 2
414+ worker1 .MaxUnavailable = ptr .To (intstr .FromInt (1 ))
415+ worker1 .MaxSurge = ptr .To (intstr .FromInt (0 ))
416+
417+ worker2 := DefaultWorker ("manual" , ptr .To (gardencorev1beta1 .ManualInPlaceUpdate ))
418+
419+ // Add a third worker pool when worker rollout should not be performed such that we can make proper
420+ // assertions of the shoot status
421+ worker3 := DefaultWorker ("rolling" , nil )
422+
423+ shoot .Spec .Provider .Workers = []gardencorev1beta1.Worker {worker1 , worker2 , worker3 }
424+
425+ s = NewTestContext ().ForShoot (shoot )
426+ })
427+
428+ // Skip the test for IPv6 single-stack Shoot as it is extremely flaky (success rate < 30%).
429+ //
430+ // TODO(shafeeqes, acumino, ary1992): Debug and fix the flaky test for ipv6.
431+ if os .Getenv ("IPFAMILY" ) == "ipv6" {
432+ s .Log .Info ("Skip the flaky credentials rotation with in-place update strategy e2e test for ipv6" )
433+ return
434+ }
435+
436+ test (s , true , true )
437+ })
394438 })
395439
396440 Context ("Workerless Shoot" , Label ("workerless" ), Ordered , func () {
0 commit comments