Commit Graph

25 Commits

Author SHA1 Message Date
1ca668ac55 Add unit tests to cli/command/formatter/stats.go
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: c1da6dc7ac
Component: cli
2016-10-27 18:00:38 +03:00
84e8a755f4 Windows: Fix stats CLI
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: dff7842790
Component: cli
2016-10-25 19:57:47 -07:00
a8ff9481ee Correct go-units import in cli/command/formatter/stats.go
from src/github.com/docker/go-units -> github.com/docker/go-units

Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
Upstream-commit: 15bbb61711
Component: cli
2016-10-24 15:06:58 -07:00
66f4ef95a8 Merge pull request #27117 from dnephin/swagger-gen
Add swagger.yaml and generate a few types from the spec
Upstream-commit: 0f7cb7208c
Component: cli
2016-10-21 18:15:28 -07:00
a202fe7779 Generate api/types:Image from the swagger spec
and rename it to a more appropriate name ImageSummary.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: ef87035bbb
Component: cli
2016-10-20 13:24:23 -07:00
b2507ea973 Add Networks placeholder to ps --format
Passing {{.Networks}} to the format parameter will prompt ps to
display all the networks the container is connected to.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 08ac5a3039
Component: cli
2016-10-20 07:41:56 -07:00
64a984b1c7 Service update failure thresholds and rollback
This adds support for two enhancements to swarm service rolling updates:

- Failure thresholds: In Docker 1.12, a service update could be set up
  to either pause or continue after a single failure occurs. This adds
  an --update-max-failure-ratio flag that controls how many tasks need to
  fail to update for the update as a whole to be considered a failure. A
  counterpart flag, --update-monitor, controls how long to monitor each
  task for a failure after starting it during the update.

- Rollback flag: service update --rollback reverts the service to its
  previous version. If a service update encounters task failures, or
  fails to function properly for some other reason, the user can roll back
  the update.

SwarmKit also has the ability to roll back updates automatically after
hitting the failure thresholds, but we've decided not to expose this in
the Docker API/CLI for now, favoring a workflow where the decision to
roll back is always made by an admin. Depending on user feedback, we may
add a "rollback" option to --update-failure-action in the future.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 06ebd4517d
Component: cli
2016-10-18 10:09:50 -07:00
67d2ba7359 Merge pull request #26519 from AkihiroSuda/fix-cli-command-formatter-json-support
Fix broken JSON support in cli/command/formatter
Upstream-commit: 3ab6e03ba3
Component: cli
2016-10-17 22:44:04 +01:00
fc18090688 Revert docker volume column name to VOLUME_NAME
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6c3c3a87ba
Component: cli
2016-10-17 20:03:31 +02:00
f0fd68b09c Fix broken JSON support in cli/command/formatter
How to test:

    $ docker ps --format '{{json .}}'
    $ docker network ls --format '{{json .}}'
    $ docker volume ls --format '{{json .}}'

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: c11155f0d1
Component: cli
2016-10-17 08:07:17 +00:00
17ee92cc91 Merge pull request #26819 from ripcurld00d/fix_stats_mutex
Hide the mutex lock in formatter.ContainerStats
Upstream-commit: bfe16dcfe2
Component: cli
2016-10-13 17:38:22 -07:00
bf3fe75f3b Move types.Volumes optional fields under a new type
This allows us to hide those fields when they are not filled.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 5018781cab
Component: cli
2016-10-11 11:49:26 -07:00
1c68035702 Hide the mutex in formatter.ContainerStats
The formatter.ContainerStats struct exposes its Mutex.
This is a bad design and should be fixed.

To fix that, I separated the statistics
attributes from ContainerStats to StatsEntry and
hid the mutex. Notice that the mutex protects both
the `err` field and the statistics attributes.

Then, implemented SetStatistics, SetError, GetStatistics
and GetError to avoid races.

Moreover, to make this less granular, I decided to
replace the read-write mutex with the regular mutex and
to pass a StatsEntry slice to formatter.ContainerStatsWrite

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 3bc50c45ba
Component: cli
2016-10-10 21:52:53 +03:00
326cca001f Add new df subcomand to the system command
This command display the state of the data usage of the docker daemon.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 3f8c4be283
Component: cli
2016-09-30 14:35:23 -07:00
6713fa0784 Update Images() to allow retrieving specific image size data
Those data include:
 - size of data shared with other images
 - size of data unique to a given image
 - how many containers are using a given image

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 82dc15836b
Component: cli
2016-09-29 07:42:53 -07:00
64b2b3acec add endpoint mode in service pretty
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: cc375fafd0
Component: cli
2016-09-27 18:41:19 +08:00
505f16cebe cli: Add more nil checking to service pretty-printer
Currently, if the service mode is not "global", this code assumes that
Replicated is non-nil. This assumption may not be true in the future.
Instead of making the assumption, explicitly check that Replicated is
non-nil before using it.

Similarly, for limits and reservations, enclose methods that read from
Limits and Reservations within checks that those fields are non-nil.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 56d92bfdff
Component: cli
2016-09-26 10:12:24 +01:00
79df3ddbda Merge pull request #24987 from ripcurld00d/stats_format_prod
Add format to stats
Upstream-commit: 685613f6c9
Component: cli
2016-09-21 10:38:21 -04:00
311b0765b1 Add formatter for service inspect
Allows the user to use `pretty` as the format string.
This enables users to put custom format options into their CLI config
just like is supported for `docker ps` and `docker images`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 20c5a9448d
Component: cli
2016-09-19 16:28:19 -04:00
a8c10a8cb0 Add the format switch to the stats command
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: a4f3442403
Component: cli
2016-09-18 14:16:13 +03:00
a43858a79d Fix testcases that expect trailing whitespace
and broken integration tests based of nil pointers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2f8c4333fe
Component: cli
2016-09-13 17:58:12 -04:00
91cf73d819 Refactor formatter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: db0952ad22
Component: cli
2016-09-13 17:58:12 -04:00
9c57f9b583 Restrict size to 2 fractional digits for docker images
This fix tries to address the issue raised in 26300. Previously
`docker images` will use `HumanSize()` to display the size which
has a fixed precision of 4 (thus 3 fractional digits). This
could be problematic in certain languages (e.g. , German, see
26300) as `.` may be interpreted as thousands-separator in number.

This fix use `CustomSize()` instead and limit the precision to 3
(thus 2 fractional digits).

This fix has been tested manually.

This fix fixes 26300.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c68bb57959
Component: cli
2016-09-08 18:26:50 -07:00
b924adb986 Fix a test that expects whitespace at the end of the line.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e2f7387906
Component: cli
2016-09-08 15:50:14 -04: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