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

Merge pull request #21172 from yongtang/20909-seccomp-in-docker-info

Show "seccomp" in docker info (#20909).
This commit is contained in:
Vincent Demeester 2016-04-15 01:24:54 +02:00
commit bc0c8828e9
4 changed files with 20 additions and 1 deletions

View file

@ -67,6 +67,17 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
}
})
var securityOptions []string
if sysInfo.AppArmor {
securityOptions = append(securityOptions, "apparmor")
}
if sysInfo.Seccomp {
securityOptions = append(securityOptions, "seccomp")
}
if selinuxEnabled() {
securityOptions = append(securityOptions, "selinux")
}
v := &types.Info{
ID: daemon.ID,
Containers: int(cRunning + cPaused + cStopped),
@ -104,6 +115,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
HTTPProxy: sockets.GetProxyEnv("http_proxy"),
HTTPSProxy: sockets.GetProxyEnv("https_proxy"),
NoProxy: sockets.GetProxyEnv("no_proxy"),
SecurityOptions: securityOptions,
}
// TODO Windows. Refactor this more once sysinfo is refactored into

View file

@ -117,6 +117,7 @@ This section lists each version from latest to oldest. Each listing includes a
[Docker Remote API v1.24](docker_remote_api_v1.24.md) documentation
* `POST /containers/create` now takes `StorageOpt` field.
* `GET /info` now returns `SecurityOptions` field, showing if `apparmor`, `seccomp`, or `selinux` is supported.
### v1.23 API changes

View file

@ -2240,6 +2240,11 @@ Display system-wide information
"127.0.0.0/8"
]
},
"SecurityOptions": [
"apparmor",
"seccomp",
"selinux"
],
"ServerVersion": "1.9.0",
"SwapLimit": false,
"SystemStatus": [["State", "Healthy"]],

View file

@ -31,7 +31,8 @@ func (s *DockerSuite) TestInfoApi(c *check.C) {
"MemTotal",
"KernelVersion",
"Driver",
"ServerVersion"}
"ServerVersion",
"SecurityOptions"}
out := string(body)
for _, linePrefix := range stringsToCheck {