Commit Graph

6 Commits

Author SHA1 Message Date
Aaron Lehmann d59f6d0933 cli: Wrong error message from "node ps" outside swarm mode
"docker node ps" behaves strangely outside swarm mode:

    $ docker node ps
    ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE       ERROR               PORTS
    Error: No such node:

It should explain that the node is not a swarm manager.

The reason this happens is that the argument to "docker node ps" defaults
to "self". The first thing the command does is try to resolve "self" to
a node ID using the /info endpoint. If there is no node ID, it tries to
use the empty string as an ID, and tries to GET /nodes/, which is not a
valid endpoint.

Change the command to check if the node ID is present in the /info
response. If it isn't, a swarm API endpoint can supply a useful error
message.

Also, avoid printing the column headers if the only following text is an
error.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-21 17:01:07 -07:00
Sebastiaan van Stijn d5d0d7795b Add missing API version annotations to commands
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-03-16 13:40:12 +01:00
Victor Vieux 55908f8a82 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-17 10:54:10 -08:00
Victor Vieux 4ae7176ffb always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>

update cobra and use Tags

Signed-off-by: Victor Vieux <vieux@docker.com>

allow client to talk to an older server

Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-08 04:55:27 -08:00
Daniel Nephin 1f0f7ecb5a Only hide commands if the env variable is set.
Better formatting for usage template.
Group commands in usage to management/operation commands.
Remove the word Docker from the description of management commands.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-19 13:28:15 -04:00
Daniel Nephin 3bd1eb4b76 Move api/client -> cli/command
Using
  gomvpkg
     -from github.com/docker/docker/api/client
     -to github.com/docker/docker/cli/command
     -vcs_mv_cmd 'git mv {{.Src}} {{.Dst}}'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 15:46:29 -04:00