diff options
author | Fabricio Voznika <fvoznika@google.com> | 2019-02-25 19:20:52 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-02-25 19:21:47 -0800 |
commit | 52a2abfca43cffdb9cafb91a4266dacf51525470 (patch) | |
tree | 9a20ef60a4ecaf232749e5d22408c5c2d3de765f /runsc/container/container.go | |
parent | 563c9ed1d6814776aa22d3a272fe55c15143fe79 (diff) |
Fix cgroup when path is relative
This can happen when 'docker run --cgroup-parent=' flag is set.
PiperOrigin-RevId: 235645559
Change-Id: Ieea3ae66939abadab621053551bf7d62d412e7ee
Diffstat (limited to 'runsc/container/container.go')
-rw-r--r-- | runsc/container/container.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go index 08a3725f5..6f092a5ce 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -295,7 +295,10 @@ func Create(id string, spec *specs.Spec, conf *boot.Config, bundleDir, consoleSo // Create and join cgroup before processes are created to ensure they are // part of the cgroup from the start (and all tneir children processes). - cg := cgroup.New(spec) + cg, err := cgroup.New(spec) + if err != nil { + return nil, err + } if cg != nil { // If there is cgroup config, install it before creating sandbox process. if err := cg.Install(spec.Linux.Resources); err != nil { |