mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +00:00
Avoid panics when logging a nil pod.deletionTimestamp
This commit is contained in:
parent
157da7d52e
commit
9a3f1a3164
@ -951,7 +951,7 @@ func FilterActivePods(logger klog.Logger, pods []*v1.Pod) []*v1.Pod {
|
|||||||
if IsPodActive(p) {
|
if IsPodActive(p) {
|
||||||
result = append(result, p)
|
result = append(result, p)
|
||||||
} else {
|
} else {
|
||||||
logger.V(4).Info("Ignoring inactive pod", "pod", klog.KObj(p), "phase", p.Status.Phase, "deletionTime", p.DeletionTimestamp)
|
logger.V(4).Info("Ignoring inactive pod", "pod", klog.KObj(p), "phase", p.Status.Phase, "deletionTime", klog.SafePtr(p.DeletionTimestamp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user