Skip to content

Commit f6f0703

Browse files
committed
fix: fix error checking in kl.killPod within SyncPod
1 parent bf07ef3 commit f6f0703

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/kubelet/kubelet.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,11 +1863,11 @@ func (kl *Kubelet) SyncPod(ctx context.Context, updateType kubetypes.SyncPodType
18631863
if !pcm.Exists(pod) && !firstSync {
18641864
p := kubecontainer.ConvertPodStatusToRunningPod(kl.getRuntime().Type(), podStatus)
18651865
if err := kl.killPod(ctx, pod, p, nil); err == nil {
1866-
if wait.Interrupted(err) {
1867-
return false, err
1868-
}
18691866
podKilled = true
18701867
} else {
1868+
if wait.Interrupted(err) {
1869+
return false, nil
1870+
}
18711871
klog.ErrorS(err, "KillPod failed", "pod", klog.KObj(pod), "podStatus", podStatus)
18721872
}
18731873
}

0 commit comments

Comments
 (0)