mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 21:14:56 +00:00
repo ensurer: wait at most one minute for repo to become ready
Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -171,8 +172,10 @@ func (r *repositoryEnsurer) EnsureRepo(ctx context.Context, namespace, volumeNam
|
||||
}
|
||||
|
||||
select {
|
||||
// TODO it doesn't really make sense to wait for the full pod volume operation timeout
|
||||
// here - repos should become ready quickly if they don't already exist.
|
||||
// repositories should become either ready or not ready quickly if they're
|
||||
// newly created.
|
||||
case <-time.After(time.Minute):
|
||||
return nil, errors.New("timed out waiting for restic repository to become ready")
|
||||
case <-ctx.Done():
|
||||
return nil, errors.New("timed out waiting for restic repository to become ready")
|
||||
case res := <-readyChan:
|
||||
|
||||
Reference in New Issue
Block a user