set default timeout, if one has not been set to this point

Signed-off-by: Mike Mayo <mike.mayoii@gmail.com>
pull/12231/head
Mike Mayo 1 year ago
parent 32c7e37e32
commit 77485456a3

@ -47,6 +47,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()
@ -65,6 +70,11 @@ func (w *waiter) waitForResources(created ResourceList) error {
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()

Loading…
Cancel
Save