Skip to content

Commit f1301c9

Browse files
committed
Fixed the logic of cgroup creation
1 parent ce071ea commit f1301c9

File tree

5 files changed

+155
-1
lines changed

5 files changed

+155
-1
lines changed

Godeps/Godeps.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/driver/executor/executor_linux.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ func (e *UniversalExecutor) applyLimits(pid int) error {
8282
func (e *UniversalExecutor) configureCgroups(resources *structs.Resources) error {
8383
e.groups = &cgroupConfig.Cgroup{}
8484
e.groups.Resources = &cgroupConfig.Resources{}
85-
e.groups.Name = structs.GenerateUUID()
85+
cgroupName := structs.GenerateUUID()
86+
cgPath, err := cgroups.GetThisCgroupDir("devices")
87+
if err != nil {
88+
return fmt.Errorf("unable to get mount point for devices sub-system: %v", err)
89+
}
90+
e.groups.Path = filepath.Join(cgPath, cgroupName)
8691

8792
// TODO: verify this is needed for things like network access
8893
e.groups.Resources.AllowAllDevices = true

vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go

+86
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/opencontainers/runc/libcontainer/utils/utils_test.go

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go

+33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)