1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/cli
Aaron Lehmann ad1c96c6a7 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
..
command cli: Wrong error message from "node ps" outside swarm mode 2017-03-21 17:01:07 -07:00
compose Fixing a small typo in compose loader package 2017-03-20 15:39:57 +01:00
config Add format to secret ls 2017-03-19 09:22:30 +02:00
debug
flags
internal/test Add --prune to stack deploy. 2017-03-14 16:09:28 -04:00
trust
cobra.go Fixed the typo in the code 2017-03-06 17:31:04 +05:30
error.go
required.go