Fix logging for next run delay
We were logging the spec interval duration, which was incorrect: 1. On failures, which use exponential backoff 2. On dependency not ready, which uses a separately defined static interval. This changes to log result.RequeueAfter directly when set.
This commit is contained in:
parent
9b1c951ac1
commit
30a8f936e2
|
|
@ -132,10 +132,11 @@ func (r *HelmReleaseReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log reconciliation duration
|
// Log reconciliation duration
|
||||||
log.Info(fmt.Sprintf("reconcilation finished in %s, next run in %s",
|
durationMsg := fmt.Sprintf("reconcilation finished in %s", time.Now().Sub(start).String())
|
||||||
time.Now().Sub(start).String(),
|
if result.RequeueAfter > 0 {
|
||||||
hr.Spec.Interval.Duration.String(),
|
durationMsg = fmt.Sprintf("%s, next run in %s", durationMsg, result.RequeueAfter.String())
|
||||||
))
|
}
|
||||||
|
log.Info(durationMsg)
|
||||||
|
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue