drivers/docker: move cgroups logic to linux build file

This commit is contained in:
Nick Ethier 2021-04-15 10:39:11 -04:00
parent 390c4c5119
commit c9216ba7d9
4 changed files with 15 additions and 5 deletions

View file

@ -0,0 +1,5 @@
package docker
func setCPUSetCgroup(path string, pid int) error {
return nil
}

View file

@ -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)
}

View 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)
}

View file

@ -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
}