mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-02-22 07:03:28 +00:00
This PR fixes incorrect usage of `logger.V(N).Error()` in the kubelet
package. The go-logr package design causes `Error()` calls to bypass
verbosity level checks entirely, meaning these logs are always printed
regardless of the configured verbosity level.
Note: In release-1.33, only pleg/generic.go uses contextual logging
(logger.V().Error). All other files use klog.V().ErrorS() which properly
respects verbosity levels, so they are NOT changed in this cherry-pick.
Files modified (1 file, 1 instance):
- pkg/kubelet/pleg/generic.go
Conversion pattern applied:
- g.logger.V(N).Error(err, "msg", ...) → g.logger.V(N).Info("msg", ..., "err", err)
Fixes: https://github.com/kubernetes/kubernetes/issues/136027
Cherry-pick of: https://github.com/kubernetes/kubernetes/pull/136028
Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>