|
52 | 52 | pollLongTimeout = 5 * time.Minute
|
53 | 53 | )
|
54 | 54 |
|
55 |
| -// type ConditionFunc func() (done bool, err error) |
56 |
| -// Poll(interval, timeout time.Duration, condition ConditionFunc) |
57 | 55 | func waitForRouteGroup(cs rgclient.ZalandoInterface, name, ns string, d time.Duration) (string, error) {
|
58 | 56 | var addr string
|
59 |
| - err := wait.Poll(10*time.Second, d, func() (done bool, err error) { |
| 57 | + err := wait.PollUntilContextTimeout(context.TODO(), 10*time.Second, d, false, func(context.Context) (done bool, err error) { |
60 | 58 | rg, err := cs.ZalandoV1().RouteGroups(ns).Get(context.TODO(), name, metav1.GetOptions{ResourceVersion: "0"})
|
61 | 59 | if err != nil {
|
62 | 60 | return true, err
|
@@ -719,7 +717,7 @@ func waitForResponseReturnResponse(req *http.Request, timeout time.Duration, exp
|
719 | 717 |
|
720 | 718 | func waitForReplicas(deploymentName, namespace string, kubeClient clientset.Interface, timeout time.Duration, desiredReplicas int) {
|
721 | 719 | interval := 20 * time.Second
|
722 |
| - err := wait.PollImmediate(interval, timeout, func() (bool, error) { |
| 720 | + err := wait.PollUntilContextTimeout(context.TODO(), interval, timeout, true, func(context.Context) (bool, error) { |
723 | 721 | deployment, err := kubeClient.AppsV1().Deployments(namespace).Get(context.TODO(), deploymentName, metav1.GetOptions{})
|
724 | 722 | if err != nil {
|
725 | 723 | framework.Failf("Failed to get replication controller %s: %v", deployment, err)
|
|
0 commit comments