Skip to content

Commit 1fb1d93

Browse files
committed
v2: Fix missing ns when openShimLog on windows
Related to #3921 (comment) Signed-off-by: Li Yuxuan <[email protected]>
1 parent 5fc0f30 commit 1fb1d93

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

runtime/v2/binary.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626

2727
"github.com/containerd/containerd/events/exchange"
2828
"github.com/containerd/containerd/log"
29+
"github.com/containerd/containerd/namespaces"
2930
"github.com/containerd/containerd/runtime"
3031
client "github.com/containerd/containerd/runtime/v2/shim"
3132
"github.com/containerd/containerd/runtime/v2/task"
@@ -74,7 +75,9 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
7475
if err != nil {
7576
return nil, err
7677
}
77-
f, err := openShimLog(context.Background(), b.bundle, client.AnonDialer)
78+
// Windows needs a namespace when openShimLog
79+
ns, _ := namespaces.Namespace(ctx)
80+
f, err := openShimLog(namespaces.WithNamespace(context.Background(), ns), b.bundle, client.AnonDialer)
7881
if err != nil {
7982
return nil, errors.Wrap(err, "open shim log pipe")
8083
}

0 commit comments

Comments
 (0)