Skip to content

Commit cbde2d2

Browse files
authored
retry failed calls when waiting for namespace ready (#3627)
The test helper NamespacesMustBeReady must retry if fails to list the existing gateways or pods, otherwise it may declare that the namespaces are ready without actually checking them. Change-Id: I358008a9e656735d660719f4fad8dbf38f60fd83
1 parent db7c408 commit cbde2d2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

conformance/utils/kubernetes/helpers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ func NamespacesMustBeReady(t *testing.T, c client.Client, timeoutConfig config.T
204204
err := c.List(ctx, gwList, client.InNamespace(ns))
205205
if err != nil {
206206
tlog.Errorf(t, "Error listing Gateways: %v", err)
207+
return false, nil
207208
}
208209
for _, gw := range gwList.Items {
209210
if val, ok := gw.Annotations[GatewayExcludedFromReadinessChecks]; ok && val == "true" {
@@ -233,6 +234,7 @@ func NamespacesMustBeReady(t *testing.T, c client.Client, timeoutConfig config.T
233234
err = c.List(ctx, podList, client.InNamespace(ns))
234235
if err != nil {
235236
tlog.Errorf(t, "Error listing Pods: %v", err)
237+
return false, nil
236238
}
237239
for _, pod := range podList.Items {
238240
if !findPodConditionInList(t, pod.Status.Conditions, "Ready", "True") &&

0 commit comments

Comments
 (0)