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

expand upon #2721 #2731

Merged
merged 1 commit into from
May 31, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions pkg/controller/datavolume/pvc-clone-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const (
CsiClone
)

const sourceInUseRequeueSeconds = time.Duration(5 * time.Second)
const sourceInUseRequeueDuration = time.Duration(5 * time.Second)

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

Expand Down Expand Up @@ -320,7 +320,7 @@ func (r *PvcCloneReconciler) syncClone(log logr.Logger, req reconcile.Request) (
if syncRes.result == nil {
syncRes.result = &reconcile.Result{}
}
syncRes.result.RequeueAfter = sourceInUseRequeueSeconds
syncRes.result.RequeueAfter = sourceInUseRequeueDuration
return syncRes,
r.syncCloneStatusPhase(&syncRes, cdiv1.CloneScheduled, nil)
}
Expand Down Expand Up @@ -524,7 +524,7 @@ func (r *PvcCloneReconciler) reconcileCsiClonePvc(log logr.Logger,
if readyToClone, err := r.isSourceReadyToClone(datavolume, CsiClone); err != nil {
return reconcile.Result{}, err
} else if !readyToClone {
return reconcile.Result{Requeue: true},
return reconcile.Result{RequeueAfter: sourceInUseRequeueDuration},
r.syncCloneStatusPhase(syncRes, cdiv1.CloneScheduled, nil)
}

Expand Down Expand Up @@ -625,7 +625,7 @@ func (r *PvcCloneReconciler) reconcileSmartClonePvc(log logr.Logger,
if readyToClone, err := r.isSourceReadyToClone(datavolume, SmartClone); err != nil {
return reconcile.Result{}, err
} else if !readyToClone {
return reconcile.Result{Requeue: true},
return reconcile.Result{RequeueAfter: sourceInUseRequeueDuration},
r.syncCloneStatusPhase(syncState, cdiv1.CloneScheduled, nil)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/datavolume/pvc-clone-controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ var _ = Describe("All DataVolume Tests", func() {
reconciler = createCloneReconciler(sc, sp, dv, pvc, snapClass, podFunc(dv), createVolumeSnapshotContentCrd(), createVolumeSnapshotClassCrd(), createVolumeSnapshotCrd())
result, err := reconciler.Reconcile(context.TODO(), reconcile.Request{NamespacedName: types.NamespacedName{Name: "test-dv", Namespace: metav1.NamespaceDefault}})
Expect(err).ToNot(HaveOccurred())
Expect(result.Requeue).To(BeTrue())
Expect(result.RequeueAfter).To(Equal(sourceInUseRequeueDuration))
By("Checking events recorded")
close(reconciler.recorder.(*record.FakeRecorder).Events)
found := false
Expand Down