kube-controller-manager: convert to structured logging

Most of the individual controllers were already converted earlier. Some log
calls were missed or added and then not updated during a rebase. Some of those
get updated here to fill those gaps.

Adding of the name to the logger used by each controller gets
consolidated in this commit. By using the name under which the
controller is registered we ensure that the names in the log
are consistent.
This commit is contained in:
Patrick Ohly
2023-03-13 09:45:42 +01:00
parent 1cb334960c
commit 99151c39b7
19 changed files with 136 additions and 130 deletions

View File

@@ -1274,7 +1274,7 @@ func (dsc *DaemonSetsController) syncDaemonSet(ctx context.Context, key string)
case err != nil && statusErr != nil:
// If there was an error, and we failed to update status,
// log it and return the original error.
klog.Error(statusErr, "Failed to update status", "daemonSet", klog.KObj(ds))
logger.Error(statusErr, "Failed to update status", "daemonSet", klog.KObj(ds))
return err
case err != nil:
return err