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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2018-06-21 15:59:43 -07:00
parent 71272dd203
commit a63252ba71
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
3 changed files with 7 additions and 31 deletions

View File

@ -6,4 +6,3 @@ Client:
Built: Wed May 30 22:21:05 2018 Built: Wed May 30 22:21:05 2018
OS/Arch: linux/amd64 OS/Arch: linux/amd64
Experimental: true Experimental: true
Stack Orchestrator: swarm

View File

@ -29,7 +29,6 @@ Client:{{if ne .Platform.Name ""}} {{.Platform.Name}}{{end}}
Built: {{.BuildTime}} Built: {{.BuildTime}}
OS/Arch: {{.Os}}/{{.Arch}} OS/Arch: {{.Os}}/{{.Arch}}
Experimental: {{.Experimental}} Experimental: {{.Experimental}}
Stack Orchestrator: {{.StackOrchestrator}}
{{- end}} {{- end}}
{{- if .ServerOK}}{{with .Server}} {{- if .ServerOK}}{{with .Server}}
@ -78,7 +77,6 @@ type clientVersion struct {
Arch string Arch string
BuildTime string `json:",omitempty"` BuildTime string `json:",omitempty"`
Experimental bool Experimental bool
StackOrchestrator string `json:",omitempty"`
} }
type kubernetesVersion struct { type kubernetesVersion struct {
@ -145,7 +143,6 @@ func runVersion(dockerCli command.Cli, opts *versionOptions) error {
Os: runtime.GOOS, Os: runtime.GOOS,
Arch: runtime.GOARCH, Arch: runtime.GOARCH,
Experimental: dockerCli.ClientInfo().HasExperimental, Experimental: dockerCli.ClientInfo().HasExperimental,
StackOrchestrator: string(orchestrator),
}, },
} }

View File

@ -11,7 +11,6 @@ import (
"gotest.tools/golden" "gotest.tools/golden"
"github.com/docker/cli/internal/test" "github.com/docker/cli/internal/test"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types" "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) 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) { func TestVersionAlign(t *testing.T) {
vi := versionInfo{ vi := versionInfo{
Client: clientVersion{ Client: clientVersion{
@ -57,7 +42,6 @@ func TestVersionAlign(t *testing.T) {
Arch: "amd64", Arch: "amd64",
BuildTime: "Wed May 30 22:21:05 2018", BuildTime: "Wed May 30 22:21:05 2018",
Experimental: true, 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, golden.String(cli.OutBuffer().String(), "docker-client-version.golden"))
assert.Check(t, is.Equal("", cli.ErrBuffer().String())) assert.Check(t, is.Equal("", cli.ErrBuffer().String()))
} }
func cleanTabs(line string) string {
return strings.Join(strings.Fields(line), " ")
}