From a63252ba711786c55be9f6ba56db3d49d1ed36e7 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 21 Jun 2018 15:59:43 -0700 Subject: [PATCH] Remove "Stack Orchestrator" from "docker version" The output of this information can be confusing, so removing until we have a better design for this. Signed-off-by: Sebastiaan van Stijn --- .../testdata/docker-client-version.golden | 15 +++++++------- cli/command/system/version.go | 3 --- cli/command/system/version_test.go | 20 ------------------- 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/cli/command/system/testdata/docker-client-version.golden b/cli/command/system/testdata/docker-client-version.golden index ceb45c3c4b..4079d5de02 100644 --- a/cli/command/system/testdata/docker-client-version.golden +++ b/cli/command/system/testdata/docker-client-version.golden @@ -1,9 +1,8 @@ Client: - Version: 18.99.5-ce - API version: 1.38 - Go version: go1.10.2 - Git commit: deadbeef - Built: Wed May 30 22:21:05 2018 - OS/Arch: linux/amd64 - Experimental: true - Stack Orchestrator: swarm + Version: 18.99.5-ce + API version: 1.38 + Go version: go1.10.2 + Git commit: deadbeef + Built: Wed May 30 22:21:05 2018 + OS/Arch: linux/amd64 + Experimental: true diff --git a/cli/command/system/version.go b/cli/command/system/version.go index 7e09053a49..925cd4a0f3 100644 --- a/cli/command/system/version.go +++ b/cli/command/system/version.go @@ -29,7 +29,6 @@ Client:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}} Built: {{.BuildTime}} OS/Arch: {{.Os}}/{{.Arch}} Experimental: {{.Experimental}} - Stack Orchestrator: {{.StackOrchestrator}} {{- end}} {{- if .ServerOK}}{{with .Server}} @@ -78,7 +77,6 @@ type clientVersion struct { Arch string BuildTime string `json:",omitempty"` Experimental bool - StackOrchestrator string `json:",omitempty"` } type kubernetesVersion struct { @@ -145,7 +143,6 @@ func runVersion(dockerCli command.Cli, opts *versionOptions) error { Os: runtime.GOOS, Arch: runtime.GOARCH, Experimental: dockerCli.ClientInfo().HasExperimental, - StackOrchestrator: string(orchestrator), }, } diff --git a/cli/command/system/version_test.go b/cli/command/system/version_test.go index 0462d440ae..b8163861b9 100644 --- a/cli/command/system/version_test.go +++ b/cli/command/system/version_test.go @@ -11,7 +11,6 @@ import ( "gotest.tools/golden" "github.com/docker/cli/internal/test" - "github.com/docker/docker/api" "github.com/docker/docker/api/types" ) @@ -31,20 +30,6 @@ func TestVersionWithoutServer(t *testing.T) { assert.Assert(t, !strings.Contains(out, "Server:"), "actual: %s", out) } -func fakeServerVersion(_ context.Context) (types.Version, error) { - return types.Version{ - Version: "docker-dev", - APIVersion: api.DefaultVersion, - }, nil -} - -func TestVersionWithOrchestrator(t *testing.T) { - cli := test.NewFakeCli(&fakeClient{serverVersion: fakeServerVersion}) - cmd := NewVersionCommand(cli) - assert.NilError(t, cmd.Execute()) - assert.Check(t, is.Contains(cleanTabs(cli.OutBuffer().String()), "Orchestrator: swarm")) -} - func TestVersionAlign(t *testing.T) { vi := versionInfo{ Client: clientVersion{ @@ -57,7 +42,6 @@ func TestVersionAlign(t *testing.T) { Arch: "amd64", BuildTime: "Wed May 30 22:21:05 2018", Experimental: true, - StackOrchestrator: "swarm", }, } @@ -68,7 +52,3 @@ func TestVersionAlign(t *testing.T) { assert.Check(t, golden.String(cli.OutBuffer().String(), "docker-client-version.golden")) assert.Check(t, is.Equal("", cli.ErrBuffer().String())) } - -func cleanTabs(line string) string { - return strings.Join(strings.Fields(line), " ") -}