open-nomad/drivers/docker/driver_linux.go
2021-06-09 11:00:39 -04:00

18 lines
402 B
Go

package docker
import (
"strings"
"github.com/opencontainers/runc/libcontainer/cgroups"
)
func setCPUSetCgroup(path string, pid int) error {
// Sometimes the container exists before we can write the
// cgroup resulting in an error which can be ignored.
err := cgroups.WriteCgroupProc(path, pid)
if err != nil && strings.Contains(err.Error(), "no such process") {
return nil
}
return err
}