mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
retry apiserver errors on e2e service tests
This commit is contained in:
parent
9ff3b7e744
commit
9d30eb88df
@ -603,7 +603,8 @@ func (j *TestJig) waitForCondition(timeout time.Duration, message string, condit
|
|||||||
pollFunc := func() (bool, error) {
|
pollFunc := func() (bool, error) {
|
||||||
svc, err := j.Client.CoreV1().Services(j.Namespace).Get(context.TODO(), j.Name, metav1.GetOptions{})
|
svc, err := j.Client.CoreV1().Services(j.Namespace).Get(context.TODO(), j.Name, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
framework.Logf("Retrying .... error trying to get Service %s: %v", j.Name, err)
|
||||||
|
return false, nil
|
||||||
}
|
}
|
||||||
if conditionFn(svc) {
|
if conditionFn(svc) {
|
||||||
service = svc
|
service = svc
|
||||||
@ -612,7 +613,7 @@ func (j *TestJig) waitForCondition(timeout time.Duration, message string, condit
|
|||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
if err := wait.PollImmediate(framework.Poll, timeout, pollFunc); err != nil {
|
if err := wait.PollImmediate(framework.Poll, timeout, pollFunc); err != nil {
|
||||||
return nil, fmt.Errorf("timed out waiting for service %q to %s", j.Name, message)
|
return nil, fmt.Errorf("timed out waiting for service %q to %s: %w", j.Name, message, err)
|
||||||
}
|
}
|
||||||
return service, nil
|
return service, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user