Browse code

Add more cgroup config to docker info

Signed-off-by: Lei Jitang <leijitang@huawei.com>

Lei Jitang authored on 2015/10/09 16:02:04
Showing 4 changed files
... ...
@@ -83,6 +83,21 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
83 83
 			if !info.SwapLimit {
84 84
 				fmt.Fprintf(cli.err, "WARNING: No swap limit support\n")
85 85
 			}
86
+			if !info.OomKillDisable {
87
+				fmt.Fprintf(cli.err, "WARNING: No oom kill disable support\n")
88
+			}
89
+			if !info.CPUCfsQuota {
90
+				fmt.Fprintf(cli.err, "WARNING: No cpu cfs quota support\n")
91
+			}
92
+			if !info.CPUCfsPeriod {
93
+				fmt.Fprintf(cli.err, "WARNING: No cpu cfs period support\n")
94
+			}
95
+			if !info.CPUShares {
96
+				fmt.Fprintf(cli.err, "WARNING: No cpu shares support\n")
97
+			}
98
+			if !info.CPUSet {
99
+				fmt.Fprintf(cli.err, "WARNING: No cpuset support\n")
100
+			}
86 101
 			if !info.IPv4Forwarding {
87 102
 				fmt.Fprintf(cli.err, "WARNING: IPv4 forwarding is disabled\n")
88 103
 			}
... ...
@@ -190,6 +190,8 @@ type Info struct {
190 190
 	SwapLimit          bool
191 191
 	CPUCfsPeriod       bool `json:"CpuCfsPeriod"`
192 192
 	CPUCfsQuota        bool `json:"CpuCfsQuota"`
193
+	CPUShares          bool
194
+	CPUSet             bool
193 195
 	IPv4Forwarding     bool
194 196
 	BridgeNfIptables   bool
195 197
 	BridgeNfIP6tables  bool `json:"BridgeNfIp6tables"`
... ...
@@ -104,6 +104,8 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
104 104
 		v.OomKillDisable = sysInfo.OomKillDisable
105 105
 		v.CPUCfsPeriod = sysInfo.CPUCfsPeriod
106 106
 		v.CPUCfsQuota = sysInfo.CPUCfsQuota
107
+		v.CPUShares = sysInfo.CPUShares
108
+		v.CPUSet = sysInfo.Cpuset
107 109
 	}
108 110
 
109 111
 	if httpProxy := os.Getenv("http_proxy"); httpProxy != "" {
... ...
@@ -89,7 +89,7 @@ list of DNS options to be used in the container.
89 89
 * `POST /build` now optionally takes a serialized map of build-time variables.
90 90
 * `GET /events` now includes a `timenano` field, in addition to the existing `time` field.
91 91
 * `GET /events` now supports filtering by image and container labels.
92
-* `GET /info` now lists engine version information.
92
+* `GET /info` now lists engine version information and return the information of `CPUShares` and `Cpuset`.
93 93
 * `GET /containers/json` will return `ImageID` of the image used by container.
94 94
 * `POST /exec/(name)/start` will now return an HTTP 409 when the container is either stopped or paused.
95 95