Merge pull request #115036 from harche/vol_attach_log

Do not log entire pod struct while attaching the volume
This commit is contained in:
Kubernetes Prow Robot
2023-04-06 03:07:47 -07:00
committed by GitHub

View File

@@ -345,12 +345,12 @@ func (rc *reconciler) attachDesiredVolumes(logger klog.Logger) {
logger.V(5).Info("Starting attacherDetacher.AttachVolume", "volume", volumeToAttach) logger.V(5).Info("Starting attacherDetacher.AttachVolume", "volume", volumeToAttach)
err := rc.attacherDetacher.AttachVolume(logger, volumeToAttach.VolumeToAttach, rc.actualStateOfWorld) err := rc.attacherDetacher.AttachVolume(logger, volumeToAttach.VolumeToAttach, rc.actualStateOfWorld)
if err == nil { if err == nil {
logger.Info("attacherDetacher.AttachVolume started", "volume", volumeToAttach) logger.Info("attacherDetacher.AttachVolume started", "volumeName", volumeToAttach.VolumeName, "nodeName", volumeToAttach.NodeName, "scheduledPods", klog.KObjSlice(volumeToAttach.ScheduledPods))
} }
if err != nil && !exponentialbackoff.IsExponentialBackoff(err) { if err != nil && !exponentialbackoff.IsExponentialBackoff(err) {
// Ignore exponentialbackoff.IsExponentialBackoff errors, they are expected. // Ignore exponentialbackoff.IsExponentialBackoff errors, they are expected.
// Log all other errors. // Log all other errors.
logger.Error(err, "attacherDetacher.AttachVolume failed to start", "volume", volumeToAttach) logger.Error(err, "attacherDetacher.AttachVolume failed to start", "volumeName", volumeToAttach.VolumeName, "nodeName", volumeToAttach.NodeName, "scheduledPods", klog.KObjSlice(volumeToAttach.ScheduledPods))
} }
} }
} }