mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #46654 from yujuhong/reduce-log-spam
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654) kubelet status manager: short-circut the evaluation if possible This avoids redundant checks in the `PodResourcesAreReclaimed`, which also logs misleading "Pod is terminated" messages on every check /cc @kubernetes/sig-node-pr-reviews
This commit is contained in:
commit
154b816a90
@ -483,7 +483,10 @@ func (m *manager) needsUpdate(uid types.UID, status versionedPodStatus) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *manager) canBeDeleted(pod *v1.Pod, status v1.PodStatus) bool {
|
func (m *manager) canBeDeleted(pod *v1.Pod, status v1.PodStatus) bool {
|
||||||
return !kubepod.IsMirrorPod(pod) && m.podDeletionSafety.PodResourcesAreReclaimed(pod, status) && pod.DeletionTimestamp != nil
|
if pod.DeletionTimestamp == nil || kubepod.IsMirrorPod(pod) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return m.podDeletionSafety.PodResourcesAreReclaimed(pod, status)
|
||||||
}
|
}
|
||||||
|
|
||||||
// needsReconcile compares the given status with the status in the pod manager (which
|
// needsReconcile compares the given status with the status in the pod manager (which
|
||||||
|
Loading…
Reference in New Issue
Block a user