@@ -631,6 +631,14 @@ var _ = Describe("OpenStackVersion controller", func() {
631631 k8s_corev1 .ConditionFalse ,
632632 )
633633
634+ // Wait for the control plane to apply the target image to the KeystoneAPI CR before
635+ // simulating readiness. Otherwise the controller may update its generation after
636+ // the readiness simulation, leaving the status stale.
637+ Eventually (func (g Gomega ) {
638+ keystoneAPI := keystone .GetKeystoneAPI (names .KeystoneAPIName )
639+ g .Expect (keystoneAPI .Spec .ContainerImage ).To (Equal (targetKeystoneAPIVersion ))
640+ }, timeout , interval ).Should (Succeed ())
641+
634642 keystone .SimulateKeystoneAPIReady (names .KeystoneAPIName )
635643 Eventually (func (g Gomega ) {
636644 th .ExpectCondition (
@@ -991,6 +999,14 @@ var _ = Describe("OpenStackVersion controller", func() {
991999 g .Expect (* OSCtlplane .Status .ContainerImages .InfraMemcachedImage ).Should (Equal (targetMemcachedVersion ))
9921000 }, timeout , interval ).Should (Succeed ())
9931001
1002+ // Wait for the control plane to apply the target image to the KeystoneAPI CR before
1003+ // simulating readiness. Otherwise the controller may update its generation after
1004+ // the readiness simulation, leaving the status stale.
1005+ Eventually (func (g Gomega ) {
1006+ keystoneAPI := keystone .GetKeystoneAPI (names .KeystoneAPIName )
1007+ g .Expect (keystoneAPI .Spec .ContainerImage ).To (Equal (targetKeystoneAPIVersion ))
1008+ }, timeout , interval ).Should (Succeed ())
1009+
9941010 keystone .SimulateKeystoneAPIReady (names .KeystoneAPIName )
9951011 Eventually (func (g Gomega ) {
9961012 th .ExpectCondition (
0 commit comments