From 52a2abfca43cffdb9cafb91a4266dacf51525470 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Mon, 25 Feb 2019 19:20:52 -0800 Subject: Fix cgroup when path is relative This can happen when 'docker run --cgroup-parent=' flag is set. PiperOrigin-RevId: 235645559 Change-Id: Ieea3ae66939abadab621053551bf7d62d412e7ee --- runsc/container/container.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'runsc/container') 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 { -- cgit v1.2.3