1
0
mirror of https://github.com/docker/cli.git synced 2026-01-15 07:40:57 +03:00

Merge pull request #11853 from EricR/doc-PkgSysInfo

Add some basic doc for SysInfo
Upstream-commit: 7cc73607a274c8795a88bf711a8d8d2cdd154bab
Component: engine
This commit is contained in:
Michael Crosby
2015-03-27 14:52:20 -07:00
2 changed files with 4 additions and 1 deletions

View File

@@ -0,0 +1 @@
SysInfo stores information about which features a kernel supports.

View File

@@ -9,6 +9,7 @@ import (
"github.com/docker/libcontainer/cgroups"
)
// SysInfo stores information about which features a kernel supports.
type SysInfo struct {
MemoryLimit bool
SwapLimit bool
@@ -16,6 +17,7 @@ type SysInfo struct {
AppArmor bool
}
// New returns a new SysInfo, using the filesystem to detect which features the kernel supports.
func New(quiet bool) *SysInfo {
sysInfo := &SysInfo{}
if cgroupMemoryMountpoint, err := cgroups.FindCgroupMountpoint("memory"); err != nil {
@@ -37,7 +39,7 @@ func New(quiet bool) *SysInfo {
}
}
// Check if AppArmor seems to be enabled on this system.
// Check if AppArmor is supported.
if _, err := os.Stat("/sys/kernel/security/apparmor"); os.IsNotExist(err) {
sysInfo.AppArmor = false
} else {