mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #23520 from yongtang/23500-docker-info-security
Add security info to `docker info`
This commit is contained in:
commit
6b4e2ad90b
3 changed files with 20 additions and 0 deletions
|
@ -94,6 +94,10 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
|
|||
fmt.Fprintf(cli.out, "Default Runtime: %s\n", info.DefaultRuntime)
|
||||
}
|
||||
|
||||
fmt.Fprintf(cli.out, "Security Options:")
|
||||
ioutils.FprintfIfNotEmpty(cli.out, " %s", strings.Join(info.SecurityOptions, " "))
|
||||
fmt.Fprintf(cli.out, "\n")
|
||||
|
||||
ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion)
|
||||
ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem)
|
||||
ioutils.FprintfIfNotEmpty(cli.out, "OSType: %s\n", info.OSType)
|
||||
|
|
|
@ -32,6 +32,7 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
|
|||
"Storage Driver:",
|
||||
"Volume:",
|
||||
"Network:",
|
||||
"Security Options:",
|
||||
}
|
||||
|
||||
if DaemonIsLinux.Condition() {
|
||||
|
|
15
integration-cli/docker_cli_info_unix_test.go
Normal file
15
integration-cli/docker_cli_info_unix_test.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
// +build !windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
func (s *DockerSuite) TestInfoSecurityOptions(c *check.C) {
|
||||
testRequires(c, SameHostDaemon, seccompEnabled, Apparmor, DaemonIsLinux)
|
||||
|
||||
out, _ := dockerCmd(c, "info")
|
||||
c.Assert(out, checker.Contains, "Security Options: apparmor seccomp")
|
||||
}
|
Loading…
Reference in a new issue