File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
internal/controller/status Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,11 @@ func removeDuplicateIndexParentRefs(parentRefs []graph.ParentRef) []graph.Parent
103103 idxToParentRef [ref .Idx ] = append (idxToParentRef [ref .Idx ], ref )
104104 }
105105
106- results := make ([]graph.ParentRef , len (idxToParentRef ))
106+ results := make ([]graph.ParentRef , 0 , len (idxToParentRef ))
107107
108108 for idx , refs := range idxToParentRef {
109109 if len (refs ) == 1 {
110- results [ idx ] = refs [0 ]
110+ results = append ( results , refs [0 ])
111111 continue
112112 }
113113
@@ -124,7 +124,7 @@ func removeDuplicateIndexParentRefs(parentRefs []graph.ParentRef) []graph.Parent
124124 }
125125 }
126126 }
127- results [ idx ] = winningParentRef
127+ results = append ( results , winningParentRef )
128128 }
129129
130130 return results
Original file line number Diff line number Diff line change @@ -445,7 +445,7 @@ func TestBuildHTTPRouteStatuses(t *testing.T) {
445445
446446 err := k8sClient .Get (context .Background (), nsname , & hr )
447447 g .Expect (err ).ToNot (HaveOccurred ())
448- g .Expect (helpers . Diff ( expected , hr . Status )) .To (BeEmpty ( ))
448+ g .Expect (expected . RouteStatus . Parents ) .To (ConsistOf ( hr . Status . Parents ))
449449 }
450450}
451451
@@ -524,7 +524,7 @@ func TestBuildGRPCRouteStatuses(t *testing.T) {
524524
525525 err := k8sClient .Get (context .Background (), nsname , & hr )
526526 g .Expect (err ).ToNot (HaveOccurred ())
527- g .Expect (helpers . Diff ( expected , hr . Status )) .To (BeEmpty ( ))
527+ g .Expect (expected . RouteStatus . Parents ) .To (ConsistOf ( hr . Status . Parents ))
528528 }
529529}
530530
@@ -601,7 +601,7 @@ func TestBuildTLSRouteStatuses(t *testing.T) {
601601
602602 err := k8sClient .Get (context .Background (), nsname , & hr )
603603 g .Expect (err ).ToNot (HaveOccurred ())
604- g .Expect (helpers . Diff ( expected , hr . Status )) .To (BeEmpty ( ))
604+ g .Expect (expected . RouteStatus . Parents ) .To (ConsistOf ( hr . Status . Parents ))
605605 }
606606}
607607
You can’t perform that action at this time.
0 commit comments