From affc1052644a88b79dc3844c359543442719187b Mon Sep 17 00:00:00 2001 From: Shukui Yang Date: Thu, 13 Oct 2016 15:55:30 +0800 Subject: [PATCH] tiny fix, add a null check for specs.Resources.Pids.Limit Signed-off-by: Shukui Yang --- libcontainer/specconv/spec_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcontainer/specconv/spec_linux.go b/libcontainer/specconv/spec_linux.go index 7e12ffd193e..19a4cc43128 100644 --- a/libcontainer/specconv/spec_linux.go +++ b/libcontainer/specconv/spec_linux.go @@ -373,7 +373,7 @@ func createCgroupConfig(name string, useSystemdCgroup bool, spec *specs.Spec) (* c.Resources.CpusetMems = *r.CPU.Mems } } - if r.Pids != nil { + if r.Pids != nil && r.Pids.Limit != nil { c.Resources.PidsLimit = *r.Pids.Limit } if r.BlockIO != nil {