Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Need to replace requeue bool with requeue duration

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
  • Loading branch information
mhenriks authored and awels committed Jun 21, 2023
1 parent ae6058a commit 116dcb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 116dcb4

Please sign in to comment.