From a59d0ac61aecae0fc7a4d7e2d6d5592b6922e84d Mon Sep 17 00:00:00 2001 From: Swagat Bora Date: Tue, 1 Jul 2025 17:41:54 +0000 Subject: [PATCH] exec: wait for I/O completion before return Signed-off-by: Swagat Bora --- pkg/cmd/container/exec.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cmd/container/exec.go b/pkg/cmd/container/exec.go index 0c087e63782..c874a4d1087 100644 --- a/pkg/cmd/container/exec.go +++ b/pkg/cmd/container/exec.go @@ -134,6 +134,10 @@ func execActionWithContainer(ctx context.Context, client *containerd.Client, con return nil } status := <-statusC + + process.IO().Wait() + process.IO().Close() + code, _, err := status.Result() if err != nil { return err