Support 'all' in orchestrator flag for docker stack ls

All other docker stack commands report an error when passed this value.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
This commit is contained in:
Mathieu Champlon
2018-04-25 14:24:46 +02:00
parent 0d7bb8adaa
commit 4d947de292
15 changed files with 144 additions and 98 deletions

View File

@ -6,7 +6,6 @@ import (
"strings"
"testing"
"github.com/docker/cli/cli/command"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
@ -39,8 +38,7 @@ func fakeServerVersion(_ context.Context) (types.Version, error) {
}
func TestVersionWithOrchestrator(t *testing.T) {
cli := test.NewFakeCli(&fakeClient{serverVersion: fakeServerVersion})
cli.SetClientInfo(func() command.ClientInfo { return command.ClientInfo{Orchestrator: "swarm"} })
cli := test.NewFakeCli(&fakeClient{serverVersion: fakeServerVersion}, test.OrchestratorSwarm)
cmd := NewVersionCommand(cli)
assert.NilError(t, cmd.Execute())
assert.Check(t, is.Contains(cleanTabs(cli.OutBuffer().String()), "Orchestrator: swarm"))