Merge pull request #125631 from SergeyKanzhelev/logFailedAdmission

improve logging of pod admission denied
This commit is contained in:
Kubernetes Prow Robot
2024-06-28 19:36:20 -07:00
committed by GitHub
3 changed files with 3 additions and 3 deletions

View File

@@ -2275,6 +2275,9 @@ func (kl *Kubelet) canAdmitPod(pods []*v1.Pod, pod *v1.Pod) (bool, string, strin
}
for _, podAdmitHandler := range kl.admitHandlers {
if result := podAdmitHandler.Admit(attrs); !result.Admit {
klog.InfoS("Pod admission denied", "podUID", attrs.Pod.UID, "pod", klog.KObj(attrs.Pod), "reason", result.Reason, "message", result.Message)
return false, result.Reason, result.Message
}
}