mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #26387 from Microsoft/jjh/securityopts
Only output security options if there are any
This commit is contained in:
commit
94bc2b1bc0
2 changed files with 9 additions and 4 deletions
|
@ -135,9 +135,11 @@ func prettyPrintInfo(dockerCli *command.DockerCli, info types.Info) error {
|
|||
fmt.Fprintf(dockerCli.Out(), "Default Runtime: %s\n", info.DefaultRuntime)
|
||||
}
|
||||
|
||||
fmt.Fprintf(dockerCli.Out(), "Security Options:")
|
||||
ioutils.FprintfIfNotEmpty(dockerCli.Out(), " %s", strings.Join(info.SecurityOptions, " "))
|
||||
fmt.Fprintf(dockerCli.Out(), "\n")
|
||||
if info.OSType == "linux" {
|
||||
fmt.Fprintf(dockerCli.Out(), "Security Options:")
|
||||
ioutils.FprintfIfNotEmpty(dockerCli.Out(), " %s", strings.Join(info.SecurityOptions, " "))
|
||||
fmt.Fprintf(dockerCli.Out(), "\n")
|
||||
}
|
||||
|
||||
ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Kernel Version: %s\n", info.KernelVersion)
|
||||
ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Operating System: %s\n", info.OperatingSystem)
|
||||
|
|
|
@ -33,10 +33,13 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
|
|||
"Storage Driver:",
|
||||
"Volume:",
|
||||
"Network:",
|
||||
"Security Options:",
|
||||
"Live Restore Enabled:",
|
||||
}
|
||||
|
||||
if daemonPlatform == "linux" {
|
||||
stringsToCheck = append(stringsToCheck, "Security Options:")
|
||||
}
|
||||
|
||||
if DaemonIsLinux.Condition() {
|
||||
stringsToCheck = append(stringsToCheck, "Runtimes:", "Default Runtime: runc")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue