From 90fc108f6da37b04d9c63051f752cc6f232810a4 Mon Sep 17 00:00:00 2001 From: Ziqi Zhao Date: Tue, 28 Nov 2023 20:02:23 +0800 Subject: [PATCH] fix kubelet trace broke in 1.28 Signed-off-by: Ziqi Zhao --- pkg/kubelet/kubelet.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 62083b62db4..0ea8b69805e 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -1960,9 +1960,11 @@ func (kl *Kubelet) SyncPod(ctx context.Context, updateType kubetypes.SyncPodType // Currently, using that context causes test failures. To remove this todoCtx, any wait.Interrupted // errors need to be filtered from result and bypass the reasonCache - cancelling the context for // SyncPod is a known and deliberate error, not a generic error. - todoCtx := context.TODO() // Call the container runtime's SyncPod callback - result := kl.containerRuntime.SyncPod(todoCtx, pod, podStatus, pullSecrets, kl.backOff) + result := kl.containerRuntime.SyncPod(ctx, pod, podStatus, pullSecrets, kl.backOff) + if wait.Interrupted(result.Error()) { + return false, err + } kl.reasonCache.Update(pod.UID, result) if err := result.Error(); err != nil { // Do not return error if the only failures were pods in backoff