1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/internal/test/daemon/daemon_windows.go
Rob Gulewich 072400fc4b Make cgroup namespaces configurable
This adds both a daemon-wide flag and a container creation property:
- Set the `CgroupnsMode: "host|private"` HostConfig property at
  container creation time to control what cgroup namespace the container
  is created in
- Set the `--default-cgroupns-mode=host|private` daemon flag to control
  what cgroup namespace containers are created in by default
- Set the default if the daemon flag is unset to "host", for backward
  compatibility
- Default to CgroupnsMode: "host" for client versions < 1.40

Signed-off-by: Rob Gulewich <rgulewich@netflix.com>
2019-05-07 10:22:16 -07:00

32 lines
833 B
Go

package daemon // import "github.com/docker/docker/internal/test/daemon"
import (
"fmt"
"strconv"
"golang.org/x/sys/windows"
"gotest.tools/assert"
)
// SignalDaemonDump sends a signal to the daemon to write a dump file
func SignalDaemonDump(pid int) {
ev, _ := windows.UTF16PtrFromString("Global\\docker-daemon-" + strconv.Itoa(pid))
h2, err := windows.OpenEvent(0x0002, false, ev)
if h2 == 0 || err != nil {
return
}
windows.PulseEvent(h2)
}
func signalDaemonReload(pid int) error {
return fmt.Errorf("daemon reload not supported")
}
func cleanupNetworkNamespace(t testingT, execRoot string) {
}
// CgroupNamespace returns the cgroup namespace the daemon is running in
func (d *Daemon) CgroupNamespace(t assert.TestingT) string {
assert.Assert(t, false)
return "cgroup namespaces are not supported on Windows"
}