Skip to content

Commit

Permalink
Fix Negative Requeue Duration in getStatusCheckDelay of DRPlacementCo…
Browse files Browse the repository at this point in the history
…ntrol Reconciler

Signed-off-by: Oded Viner <[email protected]>
  • Loading branch information
OdedViner committed Feb 20, 2025
1 parent e2d4809 commit 81fc221
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/controller/drplacementcontrol_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,10 @@ func (r *DRPlacementControlReconciler) getStatusCheckDelay(
// iteration of the reconcile loop. Hence, the next attempt to update the
// status should be after the remaining duration of this polling interval has
// elapsed: (beforeProcessing + StatusCheckDelay - time.Now())
return time.Until(beforeProcessing.Add(StatusCheckDelay))
// If the scheduled time is already in the past, requeue immediately.
remaining := time.Until(beforeProcessing.Add(StatusCheckDelay))

return max(0, remaining)
}

// updateDRPCStatus updates the DRPC sub-resource status with,
Expand Down

0 comments on commit 81fc221

Please sign in to comment.