Skip to content

Commit 30a8f93

Browse files
committed
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.
1 parent 9b1c951 commit 30a8f93

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

controllers/helmrelease_controller.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ func (r *HelmReleaseReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)
132132
}
133133

134134
// Log reconciliation duration
135-
log.Info(fmt.Sprintf("reconcilation finished in %s, next run in %s",
136-
time.Now().Sub(start).String(),
137-
hr.Spec.Interval.Duration.String(),
138-
))
135+
durationMsg := fmt.Sprintf("reconcilation finished in %s", time.Now().Sub(start).String())
136+
if result.RequeueAfter > 0 {
137+
durationMsg = fmt.Sprintf("%s, next run in %s", durationMsg, result.RequeueAfter.String())
138+
}
139+
log.Info(durationMsg)
139140

140141
return result, err
141142
}

0 commit comments

Comments
 (0)