Skip to content

Commit eafe9a7

Browse files
committed
check if in window
1 parent bcbc556 commit eafe9a7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

controllers/vaultdynamicsecret_controller.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,11 @@ func (r *VaultDynamicSecretReconciler) Reconcile(ctx context.Context, req ctrl.R
275275
// check if lease already exists
276276
if o.Status.SecretLease.ID != "" && o.Status.LastGeneration > 0 && o.Status.LastRenewalTime > 0 &&
277277
!r.SyncRegistry.Has(req.NamespacedName) && r.isRenewableLease(&o.Status.SecretLease, o, true) {
278-
logger.V(consts.LogLevelDebug).Info("Skipping sync, lease already exists")
279-
return ctrl.Result{}, nil
278+
horizon, inWindow := computeRelativeHorizonWithJitter(o, staticCredsJitterHorizon)
279+
if !inWindow {
280+
logger.V(consts.LogLevelDebug).Info("Skipping sync, lease already exists")
281+
return ctrl.Result{RequeueAfter: horizon}, nil
282+
}
280283
}
281284

282285
// sync the secret

0 commit comments

Comments
 (0)