Treat absent "linux" section is empty "cgroupsPath" too

This commit is contained in:
Konstantin Baranov
2020-10-02 14:37:55 -07:00
parent b8dc9a889f
commit 6321eccddc
+4 -1
View File
@@ -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
}