1
0
Fork 0
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:
Sebastiaan van Stijn 2016-09-16 23:05:30 +02:00 committed by GitHub
commit 94bc2b1bc0
2 changed files with 9 additions and 4 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)
} }
fmt.Fprintf(dockerCli.Out(), "Security Options:") if info.OSType == "linux" {
ioutils.FprintfIfNotEmpty(dockerCli.Out(), " %s", strings.Join(info.SecurityOptions, " ")) fmt.Fprintf(dockerCli.Out(), "Security Options:")
fmt.Fprintf(dockerCli.Out(), "\n") 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(), "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)

View file

@ -33,10 +33,13 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
"Storage Driver:", "Storage Driver:",
"Volume:", "Volume:",
"Network:", "Network:",
"Security Options:",
"Live Restore Enabled:", "Live Restore Enabled:",
} }
if daemonPlatform == "linux" {
stringsToCheck = append(stringsToCheck, "Security Options:")
}
if DaemonIsLinux.Condition() { if DaemonIsLinux.Condition() {
stringsToCheck = append(stringsToCheck, "Runtimes:", "Default Runtime: runc") stringsToCheck = append(stringsToCheck, "Runtimes:", "Default Runtime: runc")
} }