From 6d92b330e31fc580c73c31f1f82eacdb4c9bd2bd Mon Sep 17 00:00:00 2001 From: Ziqi Zhao Date: Tue, 28 Nov 2023 23:43:33 +0800 Subject: [PATCH] use ctx withoutcancel Signed-off-by: Ziqi Zhao --- pkg/kubelet/kubelet.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 0ea8b69805e..2c1b99e7624 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -1961,7 +1961,8 @@ func (kl *Kubelet) SyncPod(ctx context.Context, updateType kubetypes.SyncPodType // 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. // Call the container runtime's SyncPod callback - result := kl.containerRuntime.SyncPod(ctx, pod, podStatus, pullSecrets, kl.backOff) + sctx := context.WithoutCancel(ctx) + result := kl.containerRuntime.SyncPod(sctx, pod, podStatus, pullSecrets, kl.backOff) if wait.Interrupted(result.Error()) { return false, err }