瀏覽代碼

Merge pull request #11853 from EricR/doc-PkgSysInfo

Add some basic doc for SysInfo
Michael Crosby 10 年之前
父節點
當前提交
7cc73607a2
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 1 0
      pkg/sysinfo/README.md
  2. 3 1
      pkg/sysinfo/sysinfo.go

+ 1 - 0
pkg/sysinfo/README.md

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

+ 3 - 1
pkg/sysinfo/sysinfo.go

@@ -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 {