From 8524f5514cc0ad82c10491ac5029c5786c36d379 Mon Sep 17 00:00:00 2001 From: sw1136562366 Date: Mon, 27 May 2024 17:40:14 +0800 Subject: [PATCH] fix: fix tar copy failed (#108) --- pkg/cri/criutils/copy.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/cri/criutils/copy.go b/pkg/cri/criutils/copy.go index ed8d6db..5c43f18 100644 --- a/pkg/cri/criutils/copy.go +++ b/pkg/cri/criutils/copy.go @@ -261,10 +261,8 @@ func CopyToContainerByTar(ctx context.Context, i cri.Interface, c *cri.Container }() execErrCh := make(chan error, 1) - execCtx, cancel := context.WithCancel(ctx) - defer cancel() go func() { - _, err = i.Exec(execCtx, c, cri.ExecRequest{ + _, err = i.Exec(context.Background(), c, cri.ExecRequest{ Cmd: []string{"tar", "-xmf", "-", "-C", filepath.Dir(dstPath)}, Env: nil, WorkingDir: "",