Commit Graph

11 Commits

Author SHA1 Message Date
Djordje Lukic 9c0234bbcb
Output compact JSON by default for --format=json
With this change all `inspect` commands will output a compact JSON
representation of the elements, the default format (indented JSON) stays the
same.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-15 15:42:35 +01:00
Silvin Lubecki 84d47b544e
Add "json" as default value to format flag in all inspect commands.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-15 15:31:16 +01:00
Vincent Demeester 69fdd2a4ad
formatter package heavy refactoring
- make it possible to extract the formatter implementation from the
  "common" code, that way, the formatter package stays small
- extract some formatter into their own packages

This is essentially moving the "formatter" implementation of each type
in their respective packages. The *main* reason to do that, is to be
able to depend on `cli/command/formatter` without depending of the
implementation detail of the formatter. As of now, depending on
`cli/command/formatter` means we depend on `docker/docker/api/types`,
`docker/licensing`, … — that should not be the case. `formatter`
should hold the common code (or helpers) to easily create formatter,
not all formatter implementations.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-10-23 17:05:44 +02:00
Kir Kolyshkin 6f8070deb2 Switch from x/net/context to context
Since go 1.7, "context" is a standard package. Since go 1.9,
x/net/context merely provides some types aliased to those in
the standard context package.

The changes were performed by the following script:

for f in $(git ls-files \*.go | grep -v ^vendor/); do
	sed -i 's|golang.org/x/net/context|context|' $f
	goimports -w $f
	for i in 1 2; do
		awk '/^$/ {e=1; next;}
			/\t"context"$/ {e=0;}
			{if (e) {print ""; e=0}; print;}' < $f > $f.new && \
				mv $f.new $f
		goimports -w $f
	done
done

[v2: do awk/goimports fixup twice]
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-11 16:49:43 -07:00
Sebastiaan van Stijn 532a3942d6
Remove use of deprecated IsErr...NotFound checks
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-03 12:01:24 +02:00
Jimmy Leger 11d471d660 Add 'docker service rollback' subcommand
Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Implement runRollback to not use runUpdate

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Add version tag and add flag quiet to suppress progress output

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Removed flags from warnDetachDefault

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Used command.Cli interface

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Add detach flag on rollback command

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Create a fakeClient for service commands

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Added unit test for rollback command

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Used command.Cli interface instead of *command.DockerCli in service commands

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Revert "Removed flags from warnDetachDefault"

This reverts commit 3e4f601c8a82cc2599a755dc693409bbc47917fc.

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Fixed test.NewFakeCli instanciation

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Removed unused receiver

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Replaced cli by dockerCli

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Revert "Removed unused receiver"

This reverts commit 604ef7c13df3d019949ca81d992db501114dafce.

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Fixed last typo

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>
2017-08-16 22:18:36 +02:00
Yong Tang 657457ee2c Use `scope=swarm` for service related network inspect.
This fix use `scope=swarm` for service related network inspect.
The purpose is that, in case multiple networks with the same
name exist in different scopes, it is still possible to obtain
the network for services.

This fix is related to moby/moby#33630 and docker/cli#167

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-06-13 20:26:12 +00:00
Gaetan de Villele 295140edf2 cli: gofmt + goimports
Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
2017-05-08 10:51:30 -07:00
Tibor Vass 57230a7212 rm client and vendor it instead
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-05-08 10:33:56 -07:00
Daniel Nephin 10641c2aae Update imports.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-17 18:07:56 -04:00
Daniel Nephin 1630fc40f8 Import docker/docker/cli
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-04-17 17:40:59 -04:00