drivers/docker: move cgroups logic to linux build file
This commit is contained in:
parent
390c4c5119
commit
c9216ba7d9
5
drivers/docker/driver_darwin.go
Normal file
5
drivers/docker/driver_darwin.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
package docker
|
||||
|
||||
func setCPUSetCgroup(path string, pid int) error {
|
||||
return nil
|
||||
}
|
|
@ -5,7 +5,6 @@ package docker
|
|||
import (
|
||||
"github.com/docker/docker/oci/caps"
|
||||
docker "github.com/fsouza/go-dockerclient"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
)
|
||||
|
||||
func getPortBinding(ip string, port string) docker.PortBinding {
|
||||
|
@ -30,7 +29,3 @@ func tweakCapabilities(basics, adds, drops []string) ([]string, error) {
|
|||
}
|
||||
return effectiveCaps, nil
|
||||
}
|
||||
|
||||
func setCPUSetCgroup(path string, pid int) error {
|
||||
return cgroups.WriteCgroupProc(path, pid)
|
||||
}
|
||||
|
|
9
drivers/docker/driver_linux.go
Normal file
9
drivers/docker/driver_linux.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package docker
|
||||
|
||||
import (
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
)
|
||||
|
||||
func setCPUSetCgroup(path string, pid int) error {
|
||||
return cgroups.WriteCgroupProc(path, pid)
|
||||
}
|
|
@ -10,6 +10,7 @@ func getPortBinding(ip string, port string) docker.PortBinding {
|
|||
func tweakCapabilities(basics, adds, drops []string) ([]string, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func setCPUSetCgroup(path string, pid int) error {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue