From 6321eccddce2b59976454799dcd25bc60ce5b0e8 Mon Sep 17 00:00:00 2001 From: Konstantin Baranov Date: Fri, 2 Oct 2020 14:37:55 -0700 Subject: Treat absent "linux" section is empty "cgroupsPath" too --- 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 15c445754..21a01b5de 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -311,7 +311,10 @@ func New(conf *boot.Config, args Args) (*Container, error) { if isRoot(args.Spec) { log.Debugf("Creating new sandbox for container %q", args.ID) - if args.Spec.Linux != nil && args.Spec.Linux.CgroupsPath == "" { + if args.Spec.Linux == nil { + args.Spec.Linux = &specs.Linux{} + } + if args.Spec.Linux.CgroupsPath == "" { args.Spec.Linux.CgroupsPath = "/" + args.ID } -- cgit v1.2.3