From 12719cbd3ab851232ebdd1e78947765eb48ecfce Mon Sep 17 00:00:00 2001 From: sw1136562366 Date: Mon, 27 May 2024 16:04:15 +0800 Subject: [PATCH] fix: fix tar copy failed --- 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: "",