Skip to content

Commit

Permalink
Fixes issue with smart clone hanging while waiting for initial import
Browse files Browse the repository at this point in the history
Signed-off-by: David Vossel <davidvossel@gmail.com>
  • Loading branch information
davidvossel committed May 19, 2023
1 parent 210b9db commit 07a732e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controller/datavolume/pvc-clone-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"reflect"
"strconv"
"time"

"github.com/go-logr/logr"
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
Expand Down Expand Up @@ -62,6 +63,8 @@ const (
CsiClone
)

const sourceInUseRequeueSeconds = time.Duration(15 * time.Second)

const pvcCloneControllerName = "datavolume-pvc-clone-controller"

// ErrInvalidTermMsg reports that the termination message from the size-detection pod doesn't exists or is not a valid quantity
Expand Down Expand Up @@ -318,7 +321,7 @@ func (r *PvcCloneReconciler) syncClone(log logr.Logger, req reconcile.Request) (
if syncRes.result == nil {
syncRes.result = &reconcile.Result{}
}
syncRes.result.Requeue = true
syncRes.result.RequeueAfter = sourceInUseRequeueSeconds
return syncRes,
r.syncCloneStatusPhase(&syncRes, cdiv1.CloneScheduled, nil)
}
Expand Down

0 comments on commit 07a732e

Please sign in to comment.