using default allowed devices when linux resources is null
@@ -422,9 +422,7 @@ func CreateCgroupConfig(opts *CreateOpts) (*configs.Cgroup, error) {
c.Resources.AllowedDevices = AllowedDevices
if spec.Linux != nil {
r := spec.Linux.Resources
- if r == nil {
- return c, nil
- }
+ if r != nil {
for i, d := range spec.Linux.Resources.Devices {
var (
t = "a"
@@ -578,6 +576,7 @@ func CreateCgroupConfig(opts *CreateOpts) (*configs.Cgroup, error) {
}
}
}
+ }
// append the default allowed devices to the end of the list
c.Resources.Devices = append(c.Resources.Devices, AllowedDevices...)
return c, nil
