Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue with smart clone hanging while waiting for initial import #2721

Merged
merged 1 commit into from
May 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(5 * 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