Merge pull request #110747 from harshanarayana/cleanup/GIT-110737/logging-improvements
structured-logging: replace KObjs with KObjSlice for logging
This commit is contained in:
@@ -231,10 +231,8 @@ func (rsc *ReplicaSetController) getReplicaSetsWithSameController(rs *apps.Repli
|
||||
relatedRSs = append(relatedRSs, obj.(*apps.ReplicaSet))
|
||||
}
|
||||
|
||||
// The if check is used to avoid the overhead for the KObjs call, see
|
||||
// https://github.com/kubernetes/kubernetes/issues/106945.
|
||||
if klogV := klog.V(2); klogV.Enabled() {
|
||||
klogV.InfoS("Found related ReplicaSets", "replicaSet", klog.KObj(rs), "relatedReplicaSets", klog.KObjs(relatedRSs))
|
||||
klogV.InfoS("Found related ReplicaSets", "replicaSet", klog.KObj(rs), "relatedReplicaSets", klog.KObjSlice(relatedRSs))
|
||||
}
|
||||
|
||||
return relatedRSs
|
||||
@@ -802,7 +800,7 @@ func (rsc *ReplicaSetController) getIndirectlyRelatedPods(rs *apps.ReplicaSet) (
|
||||
relatedPods = append(relatedPods, pod)
|
||||
}
|
||||
}
|
||||
klog.V(4).InfoS("Found related pods", "kind", rsc.Kind, "object", klog.KObj(rs), "pods", klog.KObjs(relatedPods))
|
||||
klog.V(4).InfoS("Found related pods", "kind", rsc.Kind, "object", klog.KObj(rs), "pods", klog.KObjSlice(relatedPods))
|
||||
return relatedPods, nil
|
||||
}
|
||||
|
||||
|
@@ -417,5 +417,5 @@ func (rc *reconciler) reportMultiAttachError(volumeToAttach cache.VolumeToAttach
|
||||
}
|
||||
|
||||
// Log all pods for system admin
|
||||
klog.InfoS("Multi-Attach error: volume is already used by pods", "pods", klog.KObjs(pods), "attachedTo", otherNodesStr, "volume", volumeToAttach)
|
||||
klog.InfoS("Multi-Attach error: volume is already used by pods", "pods", klog.KObjSlice(pods), "attachedTo", otherNodesStr, "volume", volumeToAttach)
|
||||
}
|
||||
|
Reference in New Issue
Block a user