|
|
@ -41,6 +41,7 @@ import (
|
|
|
|
type waiter struct {
|
|
|
|
type waiter struct {
|
|
|
|
c ReadyChecker
|
|
|
|
c ReadyChecker
|
|
|
|
timeout time.Duration
|
|
|
|
timeout time.Duration
|
|
|
|
|
|
|
|
perResourceTimeout time.Duration
|
|
|
|
log func(string, ...interface{})
|
|
|
|
log func(string, ...interface{})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -68,7 +69,12 @@ func (w *waiter) waitForResources(created ResourceList) error {
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), w.timeout)
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), w.timeout)
|
|
|
|
defer cancel()
|
|
|
|
defer cancel()
|
|
|
|
|
|
|
|
|
|
|
|
return wait.PollImmediateUntil(2*time.Second, func() (bool, error) {
|
|
|
|
timeout := 2 * time.Second
|
|
|
|
|
|
|
|
if w.perResourceTimeout > timeout {
|
|
|
|
|
|
|
|
timeout = w.perResourceTimeout
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return wait.PollImmediateUntil(timeout, func() (bool, error) {
|
|
|
|
for _, v := range created {
|
|
|
|
for _, v := range created {
|
|
|
|
ready, err := w.c.IsReady(ctx, v)
|
|
|
|
ready, err := w.c.IsReady(ctx, v)
|
|
|
|
if !ready || err != nil {
|
|
|
|
if !ready || err != nil {
|
|
|
|