From dd3d223a7ea3fc35eeeb255fc97a7bc46936cae5 Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 7 Sep 2016 11:14:49 -0700 Subject: [PATCH] Only output security options if there are any Signed-off-by: John Howard --- cli/command/system/info.go | 8 +++++--- integration-cli/docker_cli_info_test.go | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cli/command/system/info.go b/cli/command/system/info.go index 259b254bd0..a2d0abad23 100644 --- a/cli/command/system/info.go +++ b/cli/command/system/info.go @@ -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) diff --git a/integration-cli/docker_cli_info_test.go b/integration-cli/docker_cli_info_test.go index b87f52e530..63171117b4 100644 --- a/integration-cli/docker_cli_info_test.go +++ b/integration-cli/docker_cli_info_test.go @@ -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") }