Commit Graph

29 Commits

Author SHA1 Message Date
5cb6ccf571 Add hidden placeholder of .Self for docker node ls --format
This commit adds a hidden placeholder of `.Self` for
`docker node ls --format` so that if the node is the same
as the current docker daemon, then a `*` is outputed.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: b807d24e56
Component: cli
2017-04-04 12:46:44 -07:00
bb53f2056e Add --format for docker node ls
This fix tries to address the comment https://github.com/docker/docker/pull/30376#discussion_r97465334
where it was not possible to specify `--format` for `docker node ls`. The `--format` flag
is a quite useful flag that could be used in many places such as completion.

This fix implements `--format` for `docker node ls` and add `nodesFormat` in config.json
so that it is possible to specify the output when `docker node ls` is invoked.

Related documentations have been updated.

A set of unit tests have been added.

This fix is related to #30376.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4fc1d6782c
Component: cli
2017-04-04 11:26:35 -07:00
3e55a3b7e8 Merge pull request #31989 from aaronlehmann/node-ps-outside-swarm-mode
cli: Wrong error message from "node ps" outside swarm mode
Upstream-commit: d37d03c9dc
Component: cli
2017-04-03 16:15:24 +02:00
25b1b9c3c2 Replace fmt.Errorf() with errors.Errorf() in the cli
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e9d6193dfd
Component: cli
2017-03-24 16:58:07 -04:00
eb1ed29f05 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>
Upstream-commit: d59f6d0933
Component: cli
2017-03-21 17:01:07 -07:00
c74c88f8f7 Add missing API version annotations to commands
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d5d0d7795b
Component: cli
2017-03-16 13:40:12 +01:00
1195f9c5ee Delete dots to align with other commands description
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
Upstream-commit: 5b67f20a91
Component: cli
2017-02-23 16:46:08 +08:00
8daaeb5db9 Merge pull request #30814 from YuPengZTE/devSwarmCliExplain
fix the type
Upstream-commit: 0eacd8a363
Component: cli
2017-02-21 00:59:58 +01:00
193f92812e fix the type
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
Upstream-commit: 03aed78d68
Component: cli
2017-02-14 09:54:27 +08:00
060813f997 Add --format to docker service ps
This fix tries to address the issue raised in 27189 where
it is not possible to support configured formatting stored in
config.json.

Since `--format` was not supported in `docker service ps`,
the flag `--format` has also been added in this fix.

This fix
1. Add `--format` to `docker service ps`
2. Add `tasksFormat` to config.json
3. Add `--format` to `docker stack ps`
4. Add `--format` to `docker node ps`

The related docs has been updated.

An integration test has been added.

This fix fixes 27189.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 53bdc98713
Component: cli
2017-02-10 16:53:04 -08:00
99b5324db7 Add some unit tests to the node and swarm cli code
Start work on adding unit tests to our cli code in order to have to
write less costly integration test.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ee8f9e084a
Component: cli
2017-01-09 18:30:15 +01:00
668bff0dea Revert "Add -a option to service/node ps"
This reverts commit 139fff2bf0ebe12b61871ba8ec8be8d51c2338db.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6ffb62368a
Component: cli
2016-11-28 18:08:45 +01:00
7487e32054 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 55908f8a82
Component: cli
2016-11-17 10:54:10 -08:00
a3f4ca2ca6 Merge pull request #28196 from allencloud/add-short-flag-for-force
add short flag for force
Upstream-commit: a11f7b1577
Component: cli
2016-11-09 18:11:58 +01:00
24e894456a add short flag for force
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 31c5b957e2
Component: cli
2016-11-09 14:40:47 +08:00
307edac963 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>
Upstream-commit: 4ae7176ffb
Component: cli
2016-11-08 04:55:27 -08:00
cd9759a86e Merge pull request #25983 from jhorwit2/jah/ps-refactor
Add -a option to service/node ps
Upstream-commit: dd33c288ec
Component: cli
2016-11-07 17:33:10 +01:00
0ee62b4e2a Add -a option to service/node ps
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
Upstream-commit: 21096cfc05
Component: cli
2016-11-06 07:40:39 -05:00
4e0dd7ba31 added node ip autodetection
Manager now auto-detects the address that an agent connects to the cluster
from and stores it. This is useful for many kinds of internal cluster
management tools.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: 2cd4028024
Component: cli
2016-11-03 08:10:14 -07:00
5da8376ad1 node rm can be applied on not only active node
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 503053819e
Component: cli
2016-11-02 17:22:04 +08:00
ca8b6d0b28 Replace all "Filter" field with "Filters" for consistency
In file `api/types/client.go`, some of the "*Options{}" structs own a
`Filters` field while some else have the name of `Filter`, this commit
will rename all `Filter` to `Filters` for consistency. Also `Filters`
is consistent with API with format `/xxx?filters=xxx`, that's why
`Filters` is the right name.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 9eceaa926f
Component: cli
2016-11-01 23:09:30 +08:00
0cbbc04944 make every node and plugin removal call api
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 49512f901c
Component: cli
2016-10-19 06:40:30 +08:00
655c82e562 Fix typs from go to Go
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 24d0191a3a
Component: cli
2016-10-18 19:40:16 +08:00
fcc2ad15e7 return nil when no node or service to avoid additional api call
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6ef1c7deaf
Component: cli
2016-10-11 10:59:16 +08:00
d882807966 add \n in engine labels display in docker node inspect xxx --pretty
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 65b1e54c73
Component: cli
2016-09-29 18:17:54 +08:00
b0a2a84ed2 Merge pull request #26299 from allencloud/support-docker-node-ps-multi-nodes
support docker node ps multiNodes
Upstream-commit: e7e32f0465
Component: cli
2016-09-23 09:50:24 +02:00
a765266b0a 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>
Upstream-commit: 1f0f7ecb5a
Component: cli
2016-09-19 13:28:15 -04:00
d47523d4c5 support docker node ps multiNodes
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6df46463a9
Component: cli
2016-09-10 02:52:48 +08:00
964a552e76 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>
Upstream-commit: 3bd1eb4b76
Component: cli
2016-09-08 15:46:29 -04:00