@@ -948,16 +948,19 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
948948 return nil
949949 })
950950
951- conditionsJSON , err := e2ekubectl .RunKubectl (f .Namespace .Name , "get" , "clusteruserdefinednetwork" , cudnName , "-o" , "jsonpath={.status.conditions}" )
952- Expect (err ).NotTo (HaveOccurred ())
953- var actualConditions []metav1.Condition
954- Expect (json .Unmarshal ([]byte (conditionsJSON ), & actualConditions )).To (Succeed ())
955-
956- Expect (actualConditions [0 ].Type ).To (Equal ("NetworkReady" ))
957- Expect (actualConditions [0 ].Status ).To (Equal (metav1 .ConditionFalse ))
958- Expect (actualConditions [0 ].Reason ).To (Equal ("NetworkAttachmentDefinitionSyncError" ))
959951 expectedMessage := fmt .Sprintf ("primary network already exist in namespace %q: %q" , primaryNetTenantNs , primaryNadName )
960- Expect (actualConditions [0 ].Message ).To (Equal (expectedMessage ))
952+ Eventually (func (g Gomega ) []metav1.Condition {
953+ conditionsJSON , err := e2ekubectl .RunKubectl (f .Namespace .Name , "get" , "clusteruserdefinednetwork" , cudnName , "-o" , "jsonpath={.status.conditions}" )
954+ g .Expect (err ).NotTo (HaveOccurred ())
955+ var actualConditions []metav1.Condition
956+ g .Expect (json .Unmarshal ([]byte (conditionsJSON ), & actualConditions )).To (Succeed ())
957+ return normalizeConditions (actualConditions )
958+ }, 5 * time .Second , 1 * time .Second ).Should (ConsistOf (metav1.Condition {
959+ Type : "NetworkReady" ,
960+ Status : metav1 .ConditionFalse ,
961+ Reason : "NetworkAttachmentDefinitionSyncError" ,
962+ Message : expectedMessage ,
963+ }))
961964 })
962965
963966 Context ("UDN Pod" , func () {
0 commit comments