@@ -730,16 +730,27 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
730730 DeferCleanup (cleanup )
731731 Expect (err ).NotTo (HaveOccurred ())
732732
733- conditionsJSON , err := e2ekubectl .RunKubectl (f .Namespace .Name , "get" , "userdefinednetwork" , primaryUdnName , "-o" , "jsonpath={.status.conditions}" )
734- Expect (err ).NotTo (HaveOccurred ())
735- var actualConditions []metav1.Condition
736- Expect (json .Unmarshal ([]byte (conditionsJSON ), & actualConditions )).To (Succeed ())
737-
738- Expect (actualConditions [0 ].Type ).To (SatisfyAny (Equal ("NetworkReady" ), Equal ("NetworkCreated" )))
739- Expect (actualConditions [0 ].Status ).To (Equal (metav1 .ConditionFalse ))
740- Expect (actualConditions [0 ].Reason ).To (Equal ("SyncError" ))
741733 expectedMessage := fmt .Sprintf ("primary network already exist in namespace %q: %q" , f .Namespace .Name , primaryNadName )
742- Expect (actualConditions [0 ].Message ).To (Equal (expectedMessage ))
734+ Eventually (func (g Gomega ) []metav1.Condition {
735+ conditionsJSON , err := e2ekubectl .RunKubectl (f .Namespace .Name , "get" , "userdefinednetwork" , primaryUdnName , "-o" , "jsonpath={.status.conditions}" )
736+ g .Expect (err ).NotTo (HaveOccurred ())
737+ var actualConditions []metav1.Condition
738+ g .Expect (json .Unmarshal ([]byte (conditionsJSON ), & actualConditions )).To (Succeed ())
739+ return normalizeConditions (actualConditions )
740+ }, 5 * time .Second , 1 * time .Second ).Should (SatisfyAny (
741+ ConsistOf (metav1.Condition {
742+ Type : "NetworkCreated" ,
743+ Status : metav1 .ConditionFalse ,
744+ Reason : "SyncError" ,
745+ Message : expectedMessage ,
746+ }),
747+ ConsistOf (metav1.Condition {
748+ Type : "NetworkReady" ,
749+ Status : metav1 .ConditionFalse ,
750+ Reason : "SyncError" ,
751+ Message : expectedMessage ,
752+ }),
753+ ))
743754 })
744755
745756 Context ("ClusterUserDefinedNetwork CRD Controller" , func () {
0 commit comments