summaryrefslogtreecommitdiffhomepage
path: root/runsc/container
diff options
context:
space:
mode:
authorKonstantin Baranov <konstantin.baranov@workato.com>2020-10-02 14:37:55 -0700
committerKonstantin Baranov <konstantin.baranov@workato.com>2020-10-02 14:37:55 -0700
commit6321eccddce2b59976454799dcd25bc60ce5b0e8 (patch)
tree6416598a241b17397eabaec41146361c1d79e1d1 /runsc/container
parentb8dc9a889f3d945bcd0f02f8ca34eb2e579e8b0e (diff)
Treat absent "linux" section is empty "cgroupsPath" too
Diffstat (limited to 'runsc/container')
-rw-r--r--runsc/container/container.go5
1 files changed, 4 insertions, 1 deletions
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
}