Invert CgroupDevicesEnabled condition

It feels better to test where it's required than listing everywhere it
is not required.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2016-05-26 13:08:53 +02:00
parent 75109b32db
commit 72fefc0441
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3

View file

@ -550,8 +550,8 @@ func NewDaemon(config *Config, registryService registry.Service, containerdRemot
sysInfo := sysinfo.New(false)
// Check if Devices cgroup is mounted, it is hard requirement for container security,
// on Linux/FreeBSD.
if runtime.GOOS != "windows" && runtime.GOOS != "solaris" && !sysInfo.CgroupDevicesEnabled {
// on Linux.
if runtime.GOOS == "linux" && !sysInfo.CgroupDevicesEnabled {
return nil, fmt.Errorf("Devices cgroup isn't mounted")
}