Sfoglia il codice sorgente

add devices cgroup check and errors

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Qiang Huang 10 anni fa
parent
commit
47e5acfbae
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      pkg/sysinfo/sysinfo.go

+ 6 - 0
pkg/sysinfo/sysinfo.go

@@ -58,5 +58,11 @@ func New(quiet bool) *SysInfo {
 	} else {
 		sysInfo.AppArmor = true
 	}
+
+	// Check if Devices cgroup is mounted, it is hard requirement for container security.
+	if _, err := cgroups.FindCgroupMountpoint("devices"); err != nil {
+		logrus.Fatalf("Error mounting devices cgroup: %v", err)
+	}
+
 	return sysInfo
 }