Skip to content

Commit 0f2b0d1

Browse files
committed
Fix windows ipc option
Signed-off-by: Min Uk Lee <[email protected]>
1 parent a89250d commit 0f2b0d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/containerutil/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ func ReconfigIPCContainer(ctx context.Context, c containerd.Container, client *c
112112
if err != nil {
113113
return err
114114
}
115-
if runtime.GOOS != "linux" {
116-
return errors.New("--pid only supported on linux")
117-
}
118115
opts, err := ipcutil.GenerateIPCOpts(ctx, ipc, client)
119116
if err != nil {
120117
return err

pkg/ipcutil/ipcutil.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"fmt"
2424
"path"
2525
"path/filepath"
26+
"runtime"
2627
"strings"
2728

2829
"github.com/containerd/containerd"
@@ -145,8 +146,10 @@ func GenerateIPCOpts(ctx context.Context, ipc IPC, client *containerd.Client) ([
145146
opts = append(opts, oci.WithDevShmSize(shmBytes/1024))
146147
}
147148
case Host:
148-
opts = append(opts, oci.WithHostNamespace(specs.IPCNamespace))
149149
opts = append(opts, withBindMountHostIPC)
150+
if runtime.GOOS != "windows" {
151+
opts = append(opts, oci.WithHostNamespace(specs.IPCNamespace))
152+
}
150153
case Shareable:
151154
if ipc.HostShmPath == nil {
152155
return nil, errors.New("ipc mode is shareable, but host shm path is nil")

0 commit comments

Comments
 (0)