diff --git a/test/extended/networking/network_segmentation.go b/test/extended/networking/network_segmentation.go index 9d77bf0c742f..c4daeeb24c64 100644 --- a/test/extended/networking/network_segmentation.go +++ b/test/extended/networking/network_segmentation.go @@ -3,6 +3,7 @@ package networking import ( "context" "encoding/json" + "errors" "fmt" "math/big" "net" @@ -676,7 +677,7 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User var actualConditions []metav1.Condition Expect(json.Unmarshal([]byte(conditionsJSON), &actualConditions)).To(Succeed()) - Expect(actualConditions[0].Type).To(Equal("NetworkReady")) + Expect(actualConditions[0].Type).To(SatisfyAny(Equal("NetworkReady"), Equal("NetworkCreated"))) Expect(actualConditions[0].Status).To(Equal(metav1.ConditionFalse)) Expect(actualConditions[0].Reason).To(Equal("SyncError")) expectedMessage := fmt.Sprintf("primary network already exist in namespace %q: %q", f.Namespace.Name, primaryNadName) @@ -768,8 +769,15 @@ func applyManifest(namespace, manifest string) error { } func waitForUserDefinedNetworkReady(namespace, name string, timeout time.Duration) error { - _, err := e2ekubectl.RunKubectl(namespace, "wait", "userdefinednetwork", name, "--for", "condition=NetworkReady=True", "--timeout", timeout.String()) - return err + _, errNetReady := e2ekubectl.RunKubectl(namespace, "wait", "userdefinednetwork", name, "--for", "condition=NetworkReady=True", "--timeout", timeout.String()) + netReady := errNetReady == nil + _, errNetCreated := e2ekubectl.RunKubectl(namespace, "wait", "userdefinednetwork", name, "--for", "condition=NetworkCreated=True", "--timeout", timeout.String()) + netCreated := errNetCreated == nil + + if netReady || netCreated { + return nil + } + return errors.Join(errNetReady, errNetCreated) } func newPrimaryUserDefinedNetworkManifest(oc *exutil.CLI, name string) string { @@ -865,6 +873,14 @@ func assertUDNStatusReportsConsumers(udnNamesapce, udnName, expectedPodName stri }).Match(condition); found { break } + if found, _ = Equal(metav1.Condition{ + Type: "NetworkCreated", + Status: "False", + Reason: "SyncError", + Message: expectedMsg, + }).Match(condition); found { + break + } } Expect(found).To(BeTrue(), "expected condition not found in %v", conditions) }