Skip to content

Commit b820e3a

Browse files
committed
⚠️ Increase log levels for controller info and errors
Reconciliation errors are going to be logged only if V >= 3, while success reconciliations are set for V >= 5. Signed-off-by: Vince Prignano <[email protected]>
1 parent ef57964 commit b820e3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/internal/controller/controller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ func (c *Controller) reconcileHandler(obj interface{}) bool {
234234
// resource to be synced.
235235
if result, err := c.Do.Reconcile(req); err != nil {
236236
c.Queue.AddRateLimited(req)
237-
log.Error(err, "Reconciler error")
237+
if log.V(3).Enabled() {
238+
log.Error(err, "Reconciler error")
239+
}
238240
ctrlmetrics.ReconcileErrors.WithLabelValues(c.Name).Inc()
239241
ctrlmetrics.ReconcileTotal.WithLabelValues(c.Name, "error").Inc()
240242
return false
@@ -257,9 +259,7 @@ func (c *Controller) reconcileHandler(obj interface{}) bool {
257259
// get queued again until another change happens.
258260
c.Queue.Forget(obj)
259261

260-
// TODO(directxman12): What does 1 mean? Do we want level constants? Do we want levels at all?
261-
log.V(1).Info("Successfully Reconciled")
262-
262+
log.V(5).Info("Successfully Reconciled")
263263
ctrlmetrics.ReconcileTotal.WithLabelValues(c.Name, "success").Inc()
264264
// Return true, don't take a break
265265
return true

0 commit comments

Comments
 (0)