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
commit 54348233b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,12 +345,12 @@ func (rc *reconciler) attachDesiredVolumes(logger klog.Logger) {
logger.V(5).Info("Starting attacherDetacher.AttachVolume", "volume", volumeToAttach)
err := rc.attacherDetacher.AttachVolume(logger, volumeToAttach.VolumeToAttach, rc.actualStateOfWorld)
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) {
// Ignore exponentialbackoff.IsExponentialBackoff errors, they are expected.
// 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))
}
}
}