0976af471c
minor refactor and changelog
18 lines
402 B
Go
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
|
|
}
|