mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #94084 from brianpursley/kubernetes-93925-logging
Add logging when fail to kill container or pod
This commit is contained in:
commit
1d1daaa044
@ -1525,6 +1525,8 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
|
||||
if !pcm.Exists(pod) && !firstSync {
|
||||
if err := kl.killPod(pod, nil, podStatus, nil); err == nil {
|
||||
podKilled = true
|
||||
} else {
|
||||
klog.Errorf("killPod for pod %q (podStatus=%v) failed: %v", format.Pod(pod), podStatus, err)
|
||||
}
|
||||
}
|
||||
// Create and Update pod's Cgroups
|
||||
|
@ -658,6 +658,7 @@ func (m *kubeGenericRuntimeManager) killContainersWithSyncResult(pod *v1.Pod, ru
|
||||
killContainerResult := kubecontainer.NewSyncResult(kubecontainer.KillContainer, container.Name)
|
||||
if err := m.killContainer(pod, container.ID, container.Name, "", gracePeriodOverride); err != nil {
|
||||
killContainerResult.Fail(kubecontainer.ErrKillContainer, err.Error())
|
||||
klog.Errorf("killContainer %q(id=%q) for pod %q failed: %v", container.Name, container.ID, format.Pod(pod), err)
|
||||
}
|
||||
containerResults <- killContainerResult
|
||||
}(container)
|
||||
|
Loading…
Reference in New Issue
Block a user