Merge pull request #124342 from zhifei92/fix-error-check

fix error checking in kl.killPod within SyncPod
This commit is contained in:
Kubernetes Prow Robot 2024-07-16 16:05:07 -07:00 committed by GitHub
commit 52c0ed4673
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1851,11 +1851,11 @@ func (kl *Kubelet) SyncPod(ctx context.Context, updateType kubetypes.SyncPodType
if !pcm.Exists(pod) && !firstSync {
p := kubecontainer.ConvertPodStatusToRunningPod(kl.getRuntime().Type(), podStatus)
if err := kl.killPod(ctx, pod, p, nil); err == nil {
if wait.Interrupted(err) {
return false, err
}
podKilled = true
} else {
if wait.Interrupted(err) {
return false, nil
}
klog.ErrorS(err, "KillPod failed", "pod", klog.KObj(pod), "podStatus", podStatus)
}
}