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 b544346
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/controller/drplacementcontrol_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,9 @@ 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)

Check failure on line 1262 in internal/controller/drplacementcontrol_controller.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

return with no blank line before (nlreturn)
}

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

0 comments on commit b544346

Please sign in to comment.