@@ -22,7 +22,7 @@ import (
2222
2323 . "github.com/onsi/ginkgo/v2"
2424 . "github.com/onsi/gomega"
25- corev1 "k8s.io/api/core/v1"
25+ k8s_corev1 "k8s.io/api/core/v1"
2626 k8s_errors "k8s.io/apimachinery/pkg/api/errors"
2727 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2828 "k8s.io/apimachinery/pkg/types"
@@ -33,6 +33,7 @@ import (
3333 . "github.com/openstack-k8s-operators/lib-common/modules/common/test/helpers"
3434 "github.com/openstack-k8s-operators/lib-common/modules/common/tls"
3535 clientv1 "github.com/openstack-k8s-operators/openstack-operator/apis/client/v1beta1"
36+ corev1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1"
3637 ovnv1 "github.com/openstack-k8s-operators/ovn-operator/api/v1beta1"
3738)
3839
@@ -162,10 +163,10 @@ var _ = Describe("OpenStackOperator controller", func() {
162163 names .OpenStackClientName ,
163164 ConditionGetterFunc (OpenStackClientConditionGetter ),
164165 clientv1 .OpenStackClientReadyCondition ,
165- corev1 .ConditionTrue ,
166+ k8s_corev1 .ConditionTrue ,
166167 )
167168
168- pod := & corev1 .Pod {}
169+ pod := & k8s_corev1 .Pod {}
169170 err := th .K8sClient .Get (ctx , names .OpenStackClientName , pod )
170171 g .Expect (pod ).Should (Not (BeNil ()))
171172 g .Expect (err ).ToNot (HaveOccurred ())
@@ -201,6 +202,8 @@ var _ = Describe("OpenStackOperator controller", func() {
201202 },
202203 },
203204 }
205+ // TODO: had to disable tls to allow control plane status to update
206+ spec ["tls" ] = map [string ]interface {}{}
204207 DeferCleanup (
205208 th .DeleteInstance ,
206209 CreateOpenStackControlPlane (names .OpenStackControlplaneName , spec ),
@@ -231,6 +234,22 @@ var _ = Describe("OpenStackOperator controller", func() {
231234 ovnDbServerSB := ovn .GetOVNDBCluster (names .OVNDbServerSBName )
232235 g .Expect (ovnDbServerSB ).Should (Not (BeNil ()))
233236 }, timeout , interval ).Should (Succeed ())
237+
238+ // set ready states for each ovn component
239+ ovn .SimulateOVNNorthdReady (names .OVNNorthdName )
240+ ovn .SimulateOVNDBClusterReady (names .OVNDbServerNBName )
241+ ovn .SimulateOVNDBClusterReady (names .OVNDbServerSBName )
242+ ovn .SimulateOVNControllerReady (names .OVNControllerName )
243+
244+ // expect the ready status to propagate to control plane object
245+ Eventually (func (g Gomega ) {
246+ th .ExpectCondition (
247+ names .OpenStackControlplaneName ,
248+ ConditionGetterFunc (OpenStackControlPlaneConditionGetter ),
249+ corev1 .OpenStackControlPlaneOVNReadyCondition ,
250+ k8s_corev1 .ConditionTrue ,
251+ )
252+ }, timeout , interval ).Should (Succeed ())
234253 })
235254
236255 It ("should remove OVN resources on disable" , func () {
@@ -265,6 +284,12 @@ var _ = Describe("OpenStackOperator controller", func() {
265284 instance := & ovnv1.OVNController {}
266285 g .Expect (th .K8sClient .Get (th .Ctx , names .OVNControllerName , instance )).Should (Not (Succeed ()))
267286 }, timeout , interval ).Should (Succeed ())
287+
288+ // expect the ovn ready condition removed to not affect deployment success
289+ Eventually (func (g Gomega ) {
290+ conditions := OpenStackControlPlaneConditionGetter (names .OpenStackControlplaneName )
291+ g .Expect (conditions .Has (corev1 .OpenStackControlPlaneOVNReadyCondition )).To (BeFalse ())
292+ }, timeout , interval ).Should (Succeed ())
268293 })
269294 })
270295})
0 commit comments