Merge pull request #26387 from Microsoft/jjh/securityopts

Only output security options if there are any
This commit is contained in:
Sebastiaan van Stijn 2016-09-16 23:05:30 +02:00 committed by GitHub
commit 3fc784d460
1 changed files with 5 additions and 3 deletions

View File

@ -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(), "Default Runtime: %s\n", info.DefaultRuntime)
} }
if info.OSType == "linux" {
fmt.Fprintf(dockerCli.Out(), "Security Options:") fmt.Fprintf(dockerCli.Out(), "Security Options:")
ioutils.FprintfIfNotEmpty(dockerCli.Out(), " %s", strings.Join(info.SecurityOptions, " ")) ioutils.FprintfIfNotEmpty(dockerCli.Out(), " %s", strings.Join(info.SecurityOptions, " "))
fmt.Fprintf(dockerCli.Out(), "\n") fmt.Fprintf(dockerCli.Out(), "\n")
}
ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Kernel Version: %s\n", info.KernelVersion) ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Kernel Version: %s\n", info.KernelVersion)
ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Operating System: %s\n", info.OperatingSystem) ioutils.FprintfIfNotEmpty(dockerCli.Out(), "Operating System: %s\n", info.OperatingSystem)