mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 09:55:44 +03:00
20 lines
424 B
Go
20 lines
424 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.
|
|
if err := cgroups.WriteCgroupProc(path, pid); err != nil {
|
|
if strings.Contains(err.Error(), "no such process") {
|
|
return nil
|
|
}
|
|
return err
|
|
}
|
|
return nil
|
|
}
|