diff --git a/pkg/kube/wait.go b/pkg/kube/wait.go index 36110d0de..3806e4888 100644 --- a/pkg/kube/wait.go +++ b/pkg/kube/wait.go @@ -49,6 +49,11 @@ type waiter struct { func (w *waiter) waitForResources(created ResourceList) error { w.log("beginning wait for %d resources with timeout of %v", len(created), w.timeout) + // Set a default timeout of 5 minutes + if w.timeout == 0 { + w.timeout = time.Minute * 5 + } + ctx, cancel := context.WithTimeout(context.Background(), w.timeout) defer cancel() @@ -103,6 +108,11 @@ func (w *waiter) isRetryableHTTPStatusCode(httpStatusCode int32) bool { func (w *waiter) waitForDeletedResources(deleted ResourceList) error { w.log("beginning wait for %d resources to be deleted with timeout of %v", len(deleted), w.timeout) + // Set a default timeout of 5 minutes + if w.timeout == 0 { + w.timeout = time.Minute * 5 + } + ctx, cancel := context.WithTimeout(context.Background(), w.timeout) defer cancel()