Skip to content

Commit 0847022

Browse files
Merge pull request #2126 from abays/fix/openstackversion-keystone-readiness-race
Fix Keystone readiness race in OpenStackVersion functional tests
2 parents 9dc9fdb + 7a897b3 commit 0847022

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎test/functional/ctlplane/openstackversion_controller_test.go‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)