@@ -414,11 +414,6 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
414414 namespaceRed := f .Namespace .Name + "-" + red
415415 namespaceBlue := f .Namespace .Name + "-" + blue
416416
417- netConfig := & networkAttachmentConfigParams {
418- topology : topology ,
419- cidr : correctCIDRFamily (oc , userDefinedv4Subnet , userDefinedv6Subnet ),
420- role : "primary" ,
421- }
422417 for _ , namespace := range []string {namespaceRed , namespaceBlue } {
423418 By ("Creating namespace " + namespace )
424419 _ , err := cs .CoreV1 ().Namespaces ().Create (context .Background (), & v1.Namespace {
@@ -428,6 +423,7 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
428423 }, metav1.CreateOptions {})
429424 Expect (err ).NotTo (HaveOccurred ())
430425 defer func () {
426+ By ("Removing namespace " + namespace )
431427 Expect (cs .CoreV1 ().Namespaces ().Delete (
432428 context .Background (),
433429 namespace ,
@@ -438,8 +434,13 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
438434 networkNamespaceMap := map [string ]string {namespaceRed : red , namespaceBlue : blue }
439435 for namespace , network := range networkNamespaceMap {
440436 By ("creating the network " + network + " in namespace " + namespace )
441- netConfig .namespace = namespace
442- netConfig .name = network
437+ netConfig := & networkAttachmentConfigParams {
438+ topology : topology ,
439+ cidr : correctCIDRFamily (oc , userDefinedv4Subnet , userDefinedv6Subnet ),
440+ role : "primary" ,
441+ namespace : namespace ,
442+ name : network ,
443+ }
443444
444445 Expect (createNetworkFn (netConfig )).To (Succeed ())
445446 // update the name because createNetworkFn may mutate the netConfig.name
@@ -601,7 +602,7 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
601602 cleanup , err := createManifest ("" , cudnManifest )
602603 DeferCleanup (func () {
603604 cleanup ()
604- By ("delete pods in test namespace to unblock CUDN CR & associate NAD deletion" )
605+ By (fmt . Sprintf ( "delete pods in %s namespace to unblock CUDN CR & associate NAD deletion" , c . namespace ) )
605606 Expect (cs .CoreV1 ().Pods (c .namespace ).DeleteCollection (context .Background (), metav1.DeleteOptions {}, metav1.ListOptions {})).To (Succeed ())
606607 _ , err := e2ekubectl .RunKubectl ("" , "delete" , "clusteruserdefinednetwork" , cudnName , "--wait" , fmt .Sprintf ("--timeout=%ds" , 120 ))
607608 Expect (err ).NotTo (HaveOccurred ())
0 commit comments