|
|
@@ -1221,11 +1221,12 @@ func (a *Agent) waitForPod(pod *v1.Pod) (error, bool) {
|
|
|
return err, false
|
|
|
}
|
|
|
defer w.Stop()
|
|
|
- for {
|
|
|
+
|
|
|
+ expireTime := time.Now().Add(time.Second * 30)
|
|
|
+
|
|
|
+ for time.Now().Unix() <= expireTime.Unix() {
|
|
|
select {
|
|
|
- case <-time.After(time.Second * 30):
|
|
|
- return goerrors.New("timed out waiting for pod"), false
|
|
|
- case <-time.Tick(time.Second):
|
|
|
+ case <-time.NewTicker(time.Second).C:
|
|
|
// poll every second in case we already missed the ready event while
|
|
|
// creating the listener.
|
|
|
pod, err = a.Clientset.CoreV1().
|
|
|
@@ -1251,6 +1252,8 @@ func (a *Agent) waitForPod(pod *v1.Pod) (error, bool) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ return goerrors.New("timed out waiting for pod"), false
|
|
|
}
|
|
|
|
|
|
func isPodReady(pod *v1.Pod) bool {
|