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