@@ -2331,15 +2331,23 @@ var _ = Describe("application credentials", func() {
23312331 ContainElement (nova .ACConsumerFinalizer ))
23322332 }, timeout , interval ).Should (Succeed ())
23332333
2334- SimulateReadyOfNovaTopServices ()
2334+ // Rotating the AC secret changes the input secret hash, which bumps
2335+ // the child generations and drives them not-ready until their
2336+ // statefulsets roll out the new config. Re-simulate on every poll so
2337+ // the workloads converge and allServicesReady lets
2338+ // FinalizeSecretRotation release the old AC consumer finalizer.
23352339 Eventually (func (g Gomega ) {
2340+ th .SimulateStatefulSetReplicaReady (novaNames .APIStatefulSetName )
2341+ th .SimulateStatefulSetReplicaReady (novaNames .SchedulerStatefulSetName )
2342+ th .SimulateStatefulSetReplicaReady (novaNames .MetadataStatefulSetName )
2343+ th .SimulateStatefulSetReplicaReady (cell0 .ConductorStatefulSetName )
23362344 secret := th .GetSecret (types.NamespacedName {
23372345 Namespace : novaNames .NovaName .Namespace ,
23382346 Name : acSecretName ,
23392347 })
23402348 g .Expect (secret .Finalizers ).NotTo (
23412349 ContainElement (nova .ACConsumerFinalizer ))
2342- }, timeout , interval ).Should (Succeed ())
2350+ }, 2 * timeout , interval ).Should (Succeed ())
23432351
23442352 Eventually (func (g Gomega ) {
23452353 n := GetNova (novaNames .NovaName )
@@ -2390,16 +2398,23 @@ var _ = Describe("application credentials", func() {
23902398 g .Expect (k8sClient .Update (ctx , n )).Should (Succeed ())
23912399 }, timeout , interval ).Should (Succeed ())
23922400
2393- SimulateReadyOfNovaTopServices ()
2394-
2401+ // Clearing the AC secret changes the input secret hash, which bumps
2402+ // the child generations and drives them not-ready until their
2403+ // statefulsets roll out the new config. Re-simulate on every poll so
2404+ // the workloads converge and allServicesReady lets
2405+ // FinalizeSecretRotation release the AC consumer finalizer.
23952406 Eventually (func (g Gomega ) {
2407+ th .SimulateStatefulSetReplicaReady (novaNames .APIStatefulSetName )
2408+ th .SimulateStatefulSetReplicaReady (novaNames .SchedulerStatefulSetName )
2409+ th .SimulateStatefulSetReplicaReady (novaNames .MetadataStatefulSetName )
2410+ th .SimulateStatefulSetReplicaReady (cell0 .ConductorStatefulSetName )
23962411 secret := th .GetSecret (types.NamespacedName {
23972412 Namespace : novaNames .NovaName .Namespace ,
23982413 Name : acSecretName ,
23992414 })
24002415 g .Expect (secret .Finalizers ).NotTo (
24012416 ContainElement (nova .ACConsumerFinalizer ))
2402- }, timeout , interval ).Should (Succeed ())
2417+ }, 2 * timeout , interval ).Should (Succeed ())
24032418
24042419 Eventually (func (g Gomega ) {
24052420 n := GetNova (novaNames .NovaName )
@@ -2611,8 +2626,11 @@ var _ = Describe("Nova controller - transport URL secret rotation", func() {
26112626
26122627 // The old secret's finalizer is only released once every Nova
26132628 // sub-service has rolled out the new transport config and reports
2614- // ready (the allServicesReady guard). Re-simulate each StatefulSet
2615- // as ready and poke a reconcile so the guarded release can fire.
2629+ // ready (the allServicesReady guard). The re-render bumps each
2630+ // StatefulSet generation and envtest does not advance
2631+ // ObservedGeneration on its own, and the re-render can lag behind
2632+ // the first poll, so re-simulate the current generation and poke a
2633+ // reconcile on every iteration until the finalizer has moved.
26162634 Eventually (func (g Gomega ) {
26172635 th .SimulateStatefulSetReplicaReady (novaNames .APIStatefulSetName )
26182636 th .SimulateStatefulSetReplicaReady (novaNames .SchedulerStatefulSetName )
@@ -2624,18 +2642,16 @@ var _ = Describe("Nova controller - transport URL secret rotation", func() {
26242642 }
26252643 n .Annotations ["test-reconcile-trigger" ] = fmt .Sprintf ("%d" , time .Now ().UnixNano ())
26262644 g .Expect (k8sClient .Update (ctx , n )).To (Succeed ())
2627- }, timeout , interval ).Should (Succeed ())
26282645
2629- Eventually (func (g Gomega ) {
26302646 secret := th .GetSecret (types.NamespacedName {
26312647 Namespace : novaNames .NovaName .Namespace ,
26322648 Name : oldSecretName ,
26332649 })
26342650 g .Expect (secret .Finalizers ).NotTo (
26352651 ContainElement (nova .TransportConsumerFinalizer ))
2636- n : = GetNova (novaNames .NovaName )
2652+ n = GetNova (novaNames .NovaName )
26372653 g .Expect (n .Status .TransportURLSecret ).To (Equal (newSecretName ))
2638- }, timeout , interval ).Should (Succeed ())
2654+ }, 2 * timeout , interval ).Should (Succeed ())
26392655 })
26402656
26412657 It ("should move the finalizer from the old to the new secret on notification transport rotation" , func () {
@@ -2697,6 +2713,13 @@ var _ = Describe("Nova controller - transport URL secret rotation", func() {
26972713 ContainElement (nova .TransportConsumerFinalizer ))
26982714 }, timeout , interval ).Should (Succeed ())
26992715
2716+ // Rotating the notifications secret re-renders every top-level
2717+ // service config, bumping each StatefulSet generation. envtest does
2718+ // not advance ObservedGeneration on its own, so the services only
2719+ // report they have applied the new input once we simulate the new
2720+ // generation as Ready. The re-render may lag behind the first poll,
2721+ // so re-simulate the current generation on every iteration until the
2722+ // consumer finalizer has moved to the rotated secret.
27002723 Eventually (func (g Gomega ) {
27012724 th .SimulateStatefulSetReplicaReady (novaNames .APIStatefulSetName )
27022725 th .SimulateStatefulSetReplicaReady (novaNames .SchedulerStatefulSetName )
@@ -2708,18 +2731,16 @@ var _ = Describe("Nova controller - transport URL secret rotation", func() {
27082731 }
27092732 n .Annotations ["test-reconcile-trigger" ] = fmt .Sprintf ("%d" , time .Now ().UnixNano ())
27102733 g .Expect (k8sClient .Update (ctx , n )).To (Succeed ())
2711- }, timeout , interval ).Should (Succeed ())
27122734
2713- Eventually (func (g Gomega ) {
27142735 secret := th .GetSecret (types.NamespacedName {
27152736 Namespace : novaNames .NovaName .Namespace ,
27162737 Name : oldNotifSecretName ,
27172738 })
27182739 g .Expect (secret .Finalizers ).NotTo (
27192740 ContainElement (nova .TransportConsumerFinalizer ))
2720- n : = GetNova (novaNames .NovaName )
2741+ n = GetNova (novaNames .NovaName )
27212742 g .Expect (n .Status .NotificationsTransportURLSecret ).To (Equal (newNotifSecretName ))
2722- }, timeout , interval ).Should (Succeed ())
2743+ }, 2 * timeout , interval ).Should (Succeed ())
27232744 })
27242745
27252746 })
0 commit comments