Commit Graph

23 Commits

Author SHA1 Message Date
83d9648a45 Add label filter for docker system prune
This fix tries to address the issue raised in 29999 where it was not
possible to mask these items (like important non-removable stuff)
from `docker system prune`.

This fix adds `label` and `label!` field for `--filter` in `system prune`,
so that it is possible to selectively prune items like:
```
$ docker container prune --filter label=foo

$ docker container prune --filter label!=bar
```

Additional unit tests and integration tests have been added.

This fix fixes 29999.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 702524732427ce028277f99f215e1fab297e6001
Component: engine
2017-04-06 09:11:25 -07:00
69182c0d50 Merge pull request #31709 from dnephin/better-errors
Replace fmt.Errorf() with errors.Errorf() in the cli
Upstream-commit: 99aaf6b9233d0a0a577e79f536288bca36794c50
Component: engine
2017-03-28 10:17:46 +02:00
d79afa43f8 Allow user to modify ingress network
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: d59d19c32818ed73cc6b4d153f2858c4fe97f50e
Component: engine
2017-03-26 15:46:18 -07:00
7cc7eec39f Replace fmt.Errorf() with errors.Errorf() in the cli
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7b7ea8ab810190018346cb7d84c161bb94f7ca60
Component: engine
2017-03-24 16:58:07 -04:00
ff11389227 Enhance network inspect to show all tasks, local & non-local, in swarm mode
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
Upstream-commit: 14f76a21db71c5a817cb4d1e27f9940cefd5c820
Component: engine
2017-03-13 17:52:08 -07:00
29e3dcbbb0 why there are so many mistakes in our repo (up to /cmd)
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: f8a40477960976f12dbbb72e5b133b5b0f05f9b3
Component: engine
2017-02-17 00:32:48 +08:00
be728731d1 Add version annotation to various flags added in 1.13
Pull request https://github.com/docker/docker/pull/27745 added support for the
client to talk to older versions of the daemon. Various flags were added to
docker 1.13 that are not compatible with older daemons.

This PR adds annotations to those flags, so that they are automatically hidden
if the daemon is older than docker 1.13 (API 1.25).

Not all new flags affect the API (some are client-side only). The following
PR's added new flags to docker 1.13 that affect the API;

- https://github.com/docker/docker/pull/23430 added `--cpu-rt-period`and `--cpu-rt-runtime`
- https://github.com/docker/docker/pull/27800 / https://github.com/docker/docker/pull/25317 added `--group` / `--group-add` / `--group-rm`
- https://github.com/docker/docker/pull/27702 added `--network` to `docker build`
- https://github.com/docker/docker/pull/25962 added `--attachable` to `docker network create`
- https://github.com/docker/docker/pull/27998 added `--compose-file` to `docker stack deploy`
- https://github.com/docker/docker/pull/22566 added `--stop-timeout` to `docker run` and `docker create`
- https://github.com/docker/docker/pull/26061 added `--init` to `docker run` and `docker create`
- https://github.com/docker/docker/pull/26941 added `--init-path` to `docker run` and `docker create`
- https://github.com/docker/docker/pull/27958 added `--cpus` on `docker run` / `docker create`
- https://github.com/docker/docker/pull/27567 added `--dns`, `--dns-opt`, and `--dns-search` to `docker service create`
- https://github.com/docker/docker/pull/27596 added `--force` to `docker service update`
- https://github.com/docker/docker/pull/27857 added `--hostname` to `docker service create`
- https://github.com/docker/docker/pull/28031 added `--hosts`, `--host-add` / `--host-rm` to `docker service create` and `docker service update`
- https://github.com/docker/docker/pull/28076 added `--tty` on `docker service create` / `docker service update`
- https://github.com/docker/docker/pull/26421 added `--update-max-failure-ratio`, `--update-monitor` and `--rollback` on `docker service update`
- https://github.com/docker/docker/pull/27369 added `--health-cmd`, `--health-interval`, `--health-retries`, `--health-timeout` and `--no-healthcheck` options to `docker service create` and `docker service update`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bbbddeebba5fb8856dc977eada90c22f1f20c394
Component: engine
2017-01-16 18:21:20 +01:00
701de0a381 Merge pull request #29226 from yongtang/28535-prune-until-follow-up
Add `--filter until=<timestamp>` for `docker container/image prune`
Upstream-commit: f1fdbeca2a39c7189b1ca8db4e4543fe77ff1150
Component: engine
2017-01-09 17:58:01 +01:00
0c3b3bfadc Add --filter until=<timestamp> for docker container/image prune
This fix is a follow up for comment
https://github.com/docker/docker/pull/28535#issuecomment-263215225

This fix provides `--filter until=<timestamp>` for `docker container/image prune`.

This fix adds `--filter until=<timestamp>` to `docker container/image prune`
so that it is possible to specify a timestamp and prune those containers/images
that are earlier than the timestamp.

Related docs has been updated

Several integration tests have been added to cover changes.

This fix fixes #28497.

This fix is related to #28535.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 58738cdee327f5de481dcf7d3d377374cbb5f13a
Component: engine
2017-01-04 14:16:42 -08:00
47aebadce2 keep network option consistent between network connect and run
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 4f9b076e8eecb19083b3875b7cacbc3b660fde75
Component: engine
2017-01-04 19:54:03 +08:00
0de1da63ca Clean some stuff from runconfig that are cli only…
… or could be in `opts` package. Having `runconfig/opts` and `opts`
doesn't really make sense and make it difficult to know where to put
some code.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c424be21b7aa732681ed019b5e547a99fdc2afa5
Component: engine
2016-12-24 13:16:00 +01:00
35037b78fd Convert DanglingOnly to Filters for docker image prune
This fix convert DanglingOnly in ImagesPruneConfig to Filters,
so that it is possible to maintain API compatibility in the future.

Several integration tests have been added to cover changes.

This fix is related to 28497.

A follow up to this PR will be done once this PR is merged.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a6be56b54e871c4e7a6e72881770a64676c27c3c
Component: engine
2016-12-02 20:08:49 -08:00
6bc43aa829 Update docs of docker network ls --filter
Currently the help output of `docker network ls --filter` is:
```
Options:
  -f, --filter value   Provide filter values (i.e. 'dangling=true') (default [])
  ...
```
This caused confusion as only the following filters are supported at the moment:
 - `driver`
 - `type`
 - `name`
 - `id`
 - `label`

This fix update the help output of `docker network ls --filter` and `network_ls.md`.
The `dangling=true` description has been replace to:
```
Options:
  -f, --filter filter   Provide filter values (i.e. 'driver=bridge')
  ...
```

This fix fixes 28786.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 2510f254eea58788c1a98987db35294beb839bb4
Component: engine
2016-11-24 08:14:36 -08:00
2e39dde1e5 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: bf95472105e5dad55314cfff599abea5b81b134a
Component: engine
2016-11-17 10:54:10 -08:00
d0ebaa81e8 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: e98e4a71110fd33852bb755a9b8b4ebc9df904db
Component: engine
2016-11-08 04:55:27 -08:00
4fb550ce0f add docker network prune
`docker network prune` prunes unused networks, including overlay ones.
`docker system prune` also prunes unused networks.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 7e24c16086a9a4f38e241e51837f2be4877c04a6
Component: engine
2016-10-25 06:43:54 +00:00
77c700603f Fix typs from go to Go
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 7dad9d5ce45f25750f339642d3b84a81cc2ba98e
Component: engine
2016-10-18 19:40:16 +08:00
f1acbf81f2 Use ListOpt for docker network create --label and docker volume create --label
This fix is related to 27049 and 27047. For `--label` flag, if string slice is
used (like 27047), then quote can not be used in command and will result in
an error :
```
line 1, column 14: bare " in non-quoted-field
```

The issue 27047 has been fixed by 27049.

Recently I found out that both `docker network create --label` and `docker volume create --label`
still use string slice and will return the same error when quotes are used.

This fix fixes `docker network create --label` and `docker volume create --label`
by using `ListOpt` (as 27049) as well.

This fix has been tested and verified manually.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e3f484241dc6eebf1c36eea6ae5ff0e5a7aaadff
Component: engine
2016-10-12 16:06:34 -07:00
89cbe8e685 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: a7c8bcac2ba60d6dd25a1157085d9245bed556ce
Component: engine
2016-09-19 13:28:15 -04:00
dd60049ff5 Fix testcases that expect trailing whitespace
and broken integration tests based of nil pointers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e16e9775d48b6cd0cc7b4a66114d1b9680aa2f31
Component: engine
2016-09-13 17:58:12 -04:00
d90a93ce88 Refactor formatter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c8336743a47216f87956b77449bd21714d3c45f1
Component: engine
2016-09-13 17:58:12 -04:00
71b78a5b8d Use opts.FilterOpt for filter flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a07be9be38a96f43a0a7bac48caf35f9370bb543
Component: engine
2016-09-13 16:20:10 -04:00
d8acc366ce 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: 0640a14b4fcba3715f7cc3bc9444f3c7f4827edd
Component: engine
2016-09-08 15:46:29 -04:00