Skip to content

Commit 1d1daaa

Browse files
authored
Merge pull request kubernetes#94084 from brianpursley/kubernetes-93925-logging
Add logging when fail to kill container or pod
2 parents 3f9123f + 6d001eb commit 1d1daaa

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pkg/kubelet/kubelet.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,8 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
15251525
if !pcm.Exists(pod) && !firstSync {
15261526
if err := kl.killPod(pod, nil, podStatus, nil); err == nil {
15271527
podKilled = true
1528+
} else {
1529+
klog.Errorf("killPod for pod %q (podStatus=%v) failed: %v", format.Pod(pod), podStatus, err)
15281530
}
15291531
}
15301532
// Create and Update pod's Cgroups

pkg/kubelet/kuberuntime/kuberuntime_container.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ func (m *kubeGenericRuntimeManager) killContainersWithSyncResult(pod *v1.Pod, ru
658658
killContainerResult := kubecontainer.NewSyncResult(kubecontainer.KillContainer, container.Name)
659659
if err := m.killContainer(pod, container.ID, container.Name, "", gracePeriodOverride); err != nil {
660660
killContainerResult.Fail(kubecontainer.ErrKillContainer, err.Error())
661+
klog.Errorf("killContainer %q(id=%q) for pod %q failed: %v", container.Name, container.ID, format.Pod(pod), err)
661662
}
662663
containerResults <- killContainerResult
663664
}(container)

0 commit comments

Comments
 (0)