Browse code

Add KernelMemory to "info" and show warning

This change adds "KernelMemory" to the /info endpoint and
shows a warning if KernelMemory is not supported by the kernel.

This makes it more consistent with the other memory-limit
options.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2016/03/02 22:35:17
Showing 4 changed files
... ...
@@ -105,6 +105,9 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
105 105
 		if !info.SwapLimit {
106 106
 			fmt.Fprintln(cli.err, "WARNING: No swap limit support")
107 107
 		}
108
+		if !info.KernelMemory {
109
+			fmt.Fprintln(cli.err, "WARNING: No kernel memory limit support")
110
+		}
108 111
 		if !info.OomKillDisable {
109 112
 			fmt.Fprintln(cli.err, "WARNING: No oom kill disable support")
110 113
 		}
... ...
@@ -111,6 +111,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
111 111
 	if runtime.GOOS != "windows" {
112 112
 		v.MemoryLimit = sysInfo.MemoryLimit
113 113
 		v.SwapLimit = sysInfo.SwapLimit
114
+		v.KernelMemory = sysInfo.KernelMemory
114 115
 		v.OomKillDisable = sysInfo.OomKillDisable
115 116
 		v.CPUCfsPeriod = sysInfo.CPUCfsPeriod
116 117
 		v.CPUCfsQuota = sysInfo.CPUCfsQuota
... ...
@@ -122,6 +122,7 @@ This section lists each version from latest to oldest.  Each listing includes a
122 122
 * `POST /containers/(name)/update` now supports updating container's restart policy.
123 123
 * `POST /networks/create` now supports enabling ipv6 on the network by setting the `EnableIPv6` field (doing this with a label will no longer work).
124 124
 * `GET /info` now returns `CgroupDriver` field showing what cgroup driver the daemon is using; `cgroupfs` or `systemd`.
125
+* `GET /info` now returns `KernelMemory` field, showing if "kernel memory limit" is supported.
125 126
 
126 127
 ### v1.22 API changes
127 128
 
... ...
@@ -2161,6 +2161,7 @@ Display system-wide information
2161 2161
         "IndexServerAddress": "https://index.docker.io/v1/",
2162 2162
         "InitPath": "/usr/bin/docker",
2163 2163
         "InitSha1": "",
2164
+        "KernelMemory": true,
2164 2165
         "KernelVersion": "3.12.0-1-amd64",
2165 2166
         "Labels": [
2166 2167
             "storage=ssd"