v2: Fix missing ns when openShimLog on windows
Related to https://github.com/containerd/containerd/pull/3921#discussion_r363046745 Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
This commit is contained in:
parent
5fc0f30167
commit
1fb1d93212
@ -26,6 +26,7 @@ import (
|
||||
|
||||
"github.com/containerd/containerd/events/exchange"
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/containerd/containerd/namespaces"
|
||||
"github.com/containerd/containerd/runtime"
|
||||
client "github.com/containerd/containerd/runtime/v2/shim"
|
||||
"github.com/containerd/containerd/runtime/v2/task"
|
||||
@ -74,7 +75,9 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
f, err := openShimLog(context.Background(), b.bundle, client.AnonDialer)
|
||||
// Windows needs a namespace when openShimLog
|
||||
ns, _ := namespaces.Namespace(ctx)
|
||||
f, err := openShimLog(namespaces.WithNamespace(context.Background(), ns), b.bundle, client.AnonDialer)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "open shim log pipe")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user