Retry Pods.List, as it may fails when the apiserver is being rescheduled

pull/5784/head
Thomas Stromberg 2019-10-29 21:53:30 -07:00
parent 279915a38d
commit 5ac8aef303
1 changed files with 2 additions and 3 deletions

View File

@ -227,9 +227,8 @@ func PodWait(ctx context.Context, t *testing.T, profile string, ns string, selec
f := func() (bool, error) {
pods, err := client.CoreV1().Pods(ns).List(listOpts)
if err != nil {
t.Logf("Pod(%s).List(%v) returned error: %v", ns, selector, err)
// Don't bother to retry: something is very wrong.
return true, err
t.Logf("WARNING: Pod(%s).List(%v) returned error: %v", ns, selector, err)
return false, err
}
if len(pods.Items) == 0 {
podStart = time.Time{}