From dcd27a9f6fd66f2fbc1b6237ac174cab2f306957 Mon Sep 17 00:00:00 2001 From: Karel Suta Date: Thu, 17 Aug 2023 14:14:04 +0200 Subject: [PATCH] Test support: return default status if Route is not initialized --- test/support/conditions.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/support/conditions.go b/test/support/conditions.go index 70d0ebe9c..4ef4be1ee 100644 --- a/test/support/conditions.go +++ b/test/support/conditions.go @@ -42,6 +42,10 @@ func ConditionStatus[T conditionType](conditionType T) func(any) corev1.Conditio return c.Status } case *routev1.Route: + if len(o.Status.Ingress) == 0 { + // Route is not initialized yet + break + } if c := getRouteCondition(o.Status.Ingress[0].Conditions, routev1.RouteIngressConditionType(conditionType)); c != nil { return c.Status }