1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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>
This commit is contained in:
Sebastiaan van Stijn 2016-03-02 14:35:17 +01:00
parent 508a17baba
commit 747a486b4a
4 changed files with 6 additions and 0 deletions

View file

@ -105,6 +105,9 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
if !info.SwapLimit { if !info.SwapLimit {
fmt.Fprintln(cli.err, "WARNING: No swap limit support") fmt.Fprintln(cli.err, "WARNING: No swap limit support")
} }
if !info.KernelMemory {
fmt.Fprintln(cli.err, "WARNING: No kernel memory limit support")
}
if !info.OomKillDisable { if !info.OomKillDisable {
fmt.Fprintln(cli.err, "WARNING: No oom kill disable support") fmt.Fprintln(cli.err, "WARNING: No oom kill disable support")
} }

View file

@ -111,6 +111,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
if runtime.GOOS != "windows" { if runtime.GOOS != "windows" {
v.MemoryLimit = sysInfo.MemoryLimit v.MemoryLimit = sysInfo.MemoryLimit
v.SwapLimit = sysInfo.SwapLimit v.SwapLimit = sysInfo.SwapLimit
v.KernelMemory = sysInfo.KernelMemory
v.OomKillDisable = sysInfo.OomKillDisable v.OomKillDisable = sysInfo.OomKillDisable
v.CPUCfsPeriod = sysInfo.CPUCfsPeriod v.CPUCfsPeriod = sysInfo.CPUCfsPeriod
v.CPUCfsQuota = sysInfo.CPUCfsQuota v.CPUCfsQuota = sysInfo.CPUCfsQuota

View file

@ -122,6 +122,7 @@ This section lists each version from latest to oldest. Each listing includes a
* `POST /containers/(name)/update` now supports updating container's restart policy. * `POST /containers/(name)/update` now supports updating container's restart policy.
* `POST /networks/create` now supports enabling ipv6 on the network by setting the `EnableIPv6` field (doing this with a label will no longer work). * `POST /networks/create` now supports enabling ipv6 on the network by setting the `EnableIPv6` field (doing this with a label will no longer work).
* `GET /info` now returns `CgroupDriver` field showing what cgroup driver the daemon is using; `cgroupfs` or `systemd`. * `GET /info` now returns `CgroupDriver` field showing what cgroup driver the daemon is using; `cgroupfs` or `systemd`.
* `GET /info` now returns `KernelMemory` field, showing if "kernel memory limit" is supported.
### v1.22 API changes ### v1.22 API changes

View file

@ -2161,6 +2161,7 @@ Display system-wide information
"IndexServerAddress": "https://index.docker.io/v1/", "IndexServerAddress": "https://index.docker.io/v1/",
"InitPath": "/usr/bin/docker", "InitPath": "/usr/bin/docker",
"InitSha1": "", "InitSha1": "",
"KernelMemory": true,
"KernelVersion": "3.12.0-1-amd64", "KernelVersion": "3.12.0-1-amd64",
"Labels": [ "Labels": [
"storage=ssd" "storage=ssd"