Commit Graph

572 Commits

Author SHA1 Message Date
bbac6dc261 Add format to secret ls
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 1bac314da5
Component: cli
2017-03-19 09:22:30 +02:00
4009dade43 Implement server-side rollback, for daemon versions that support this
Server-side rollback can take advantage of the rollback-specific update
parameters, instead of being treated as a normal update that happens to
go back to a previous version of the spec.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 78c204ef79
Component: cli
2017-03-03 16:33:34 -08:00
b3a86717f1 Add support for rollback flags
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 8de01fb7a8
Component: cli
2017-03-03 16:33:34 -08:00
3fc9649978 Add support for the "rollback" failure action
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 5232868f46
Component: cli
2017-03-03 16:33:34 -08:00
1fcffa8b01 Fix error caused by overlapping merge of 30733
This fix fixes build error caused by overlapping merge of 30733 and 28213.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e94294e902
Component: cli
2017-03-03 13:26:00 -08:00
05f8d09e46 Merge pull request #30733 from yongtang/02022017-formatter-header
Allow `--format` to use different delim in `table` format
Upstream-commit: 9fb77af2e6
Component: cli
2017-03-03 11:25:19 -08:00
f2d2a3e9a6 Merge pull request #30725 from aaronlehmann/topology
Topology-aware scheduling
Upstream-commit: ff11b0523d
Component: cli
2017-03-03 15:01:12 +01:00
00fbdfcce4 Merge pull request #31409 from yuexiao-wang/fix-version
'docker daemon' deprecation message doesn't use the new version
Upstream-commit: 1da02be7f5
Component: cli
2017-03-02 22:02:09 -05:00
96ae1f807e 'docker daemon' deprecation message doesn't use the new versioning scheme
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 3f82787403
Component: cli
2017-03-03 17:26:49 +08:00
fd3a8adfe2 Merge pull request #30754 from yongtang/25696-stop-signal
Add `--stop-signal` for `service create` and `service update`
Upstream-commit: decce9cad1
Component: cli
2017-03-01 18:10:57 +01:00
c367119f5f Merge pull request #31124 from vdemeester/volume-unit-tests
Add unit tests to cli/command/volume package
Upstream-commit: 04d124ff1b
Component: cli
2017-03-01 14:13:47 +01:00
f87541dc93 Merge pull request #31290 from thaJeztah/print-d_type_warning
add d_type warning to docker info, and optimize output
Upstream-commit: 59f2b071df
Component: cli
2017-02-28 16:35:00 +01:00
3d78fa6385 Topology-aware scheduling
This adds support for placement preferences in Swarm services.

- Convert PlacementPreferences between GRPC API and HTTP API
- Add --placement-pref, --placement-pref-add and --placement-pref-rm to CLI
- Add support for placement preferences in service inspect --pretty
- Add integration test

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 21d5d1fa9d
Component: cli
2017-02-27 13:29:54 -08:00
7e228fcaaf Add unit tests to cli/command/volume package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 407d65df9d
Component: cli
2017-02-27 18:39:35 +01:00
a6a721cf4e Merge pull request #30383 from TDAbboud/30096-add-host-docker-build
Add --add-host for docker build
Upstream-commit: 7665cb52dc
Component: cli
2017-02-27 12:42:18 +01:00
f341d1bde4 Merge pull request #31212 from fate-grand-order/fixed
use t.Fatal() to output the err message and fix typo
Upstream-commit: 76b6faa13d
Component: cli
2017-02-27 12:26:35 +09:00
f51c729cfc Fixed typo.
Signed-off-by: Genki Takiuchi <genki@s21g.com>
Upstream-commit: 5a53ae5170
Component: cli
2017-02-26 12:59:18 +09:00
b6d88b7b92 add d_type warning to docker info, and optimize output
The overlay(2) drivers were moved up in the list of storage drivers,
and are known to have problems if the backing filesystem does not
support d_type.

Commit 2e20e63da2a8a0ffbbb3f2146f87559e17f43046 added a warning,
which is logged in the daemon logs, however, many users do not
check those logs, and may overlook this warning.

This patch adds the same warning to the output of `docker info`
so that the warning is more easily found.

In addition, the output of warnings printed by `docker info` is
optimized, by;

- moving all warnings to the _end_ of the output, instead of
  mixing them with the regular output
- wrapping the storage-driver warnings, so that they are more
  easily readable

Example output with this patch applied
============================================

devicemapper using loopback devices:

    ...
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false

    WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
             Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
    WARNING: bridge-nf-call-iptables is disabled
    WARNING: bridge-nf-call-ip6tables is disabled

overlay2 on xfs without d_type support;

    ...
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false

    WARNING: overlay2: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.
             Reformat the filesystem with ftype=1 to enable d_type support.
             Running without d_type support will not be supported in future releases.
    WARNING: bridge-nf-call-iptables is disabled

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b09aa604c8
Component: cli
2017-02-23 13:36:57 +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
5145dfe136 use t.Fatal() to output the err message where the values used for formatting
text does not appear to contain a placeholder

Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>
Upstream-commit: 98c222239e
Component: cli
2017-02-23 10:16:22 +08:00
e1a9ffba6b Add --stop-signal for service create and service update
This fix tries to address the issue raised in 25696 where
it was not possible to specify `--stop-signal` for `docker service create`
and `docker service update`, in order to use special signal to stop
the container.

This fix adds `--stop-signal` and update the `StopSignal` in `Config`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 25696.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9037f77d31
Component: cli
2017-02-21 15:19:45 -08:00
19b5092756 Merge pull request #31206 from xuzhenglun/master
fix wrong print format
Upstream-commit: adcf82c65a
Component: cli
2017-02-21 14:13:32 -08:00
b7afa18df2 fix wrong print format
Signed-off-by: Reficul <xuzhenglun@gmail.com>
Upstream-commit: a77cf51173
Component: cli
2017-02-21 10:26:06 +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
4b398302d7 Add --add-host for docker build
Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
Upstream-commit: e66e519e8d
Component: cli
2017-02-20 17:32:28 -05:00
d7f5ca1d45 add missing API changes
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: e858f5f7c4
Component: cli
2017-02-19 01:33:43 -08:00
d296e1a385 Merge pull request #28213 from yongtang/11062016-service-ps-format
Add `--format` to `docker service ps`
Upstream-commit: 91da14c343
Component: cli
2017-02-17 10:23:18 -08:00
0f240849ec Merge pull request #31114 from allencloud/split-compose-stack-deploy-from-deploydotgo
split compose deploy from deploy.go
Upstream-commit: cd904a5294
Component: cli
2017-02-17 08:48:51 -08:00
5dcfa95c07 Merge pull request #30848 from nishanttotla/suppress-digest-docker-ps
Suppressing image digest in docker ps
Upstream-commit: 798ed3eb6c
Component: cli
2017-02-17 10:27:49 +01:00
00c0b3590a split compose deploy from deploy.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 16b1631594
Component: cli
2017-02-17 17:13:31 +08:00
ed5a89b79a Merge pull request #31088 from xulike666/make-code-readable-again
Typo fixed and this time I provide my cSpell.json
Upstream-commit: 7377abd9e0
Component: cli
2017-02-16 22:04:27 -05:00
9ca4d7a35c Suppressing image digest in docker ps
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 9e78c9b063
Component: cli
2017-02-16 18:11:56 -08:00
6fa6de6703 why there are so many mistakes in our repo (up to /cmd)
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: ca2aeb5a3e
Component: cli
2017-02-17 00:32:48 +08:00
c0bbf0e6a7 Sort docker stack ls by name
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ddae8d967b
Component: cli
2017-02-16 14:30:39 +01:00
8a6ea28359 Merge pull request #29819 from vdemeester/service-validate-publish-simple-syntax
Make sure we validate simple syntax on service commands
Upstream-commit: 1de08ac417
Component: cli
2017-02-15 12:31:46 -08: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
a693b1f09e Merge pull request #30900 from YuPengZTE/devPublisedPort
Add "=" before the value of PublishedPort
Upstream-commit: 6cae9ce20b
Component: cli
2017-02-12 21:56:43 +01:00
e6e37cf26c Ignore some functions in the Go template when header is rendered
This fix ignore some functions in the Go template when header is
redendered, so that `--format "{{truncate .ID 1}}"` will still
be able to redener the header correctly.

Additional test cases have been added to the unit test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 82bf90ffbc
Component: cli
2017-02-10 19:34:50 -08:00
2c4a067a4b Allow --format to use different delim in table format
This fix is an attempt to address
https://github.com/docker/docker/pull/28213#issuecomment-273840405

Currently when specify table format with table `--format "table {{.ID}}..."`,
the delimiter in the header section of the table is always `"\t"`.
That is actually different from the content of the table as the delimiter
could be anything (or even contatenated with `.`, for example):
```
$ docker service ps web --format 'table {{.Name}}.{{.ID}}' --no-trunc

NAME                ID
web.1.inyhxhvjcijl0hdbu8lgrwwh7
 \_ web.1.p9m4kx2srjqmfms4igam0uqlb
```

This fix is an attampt to address the skewness of the table when delimiter
is not `"\t"`.

The basic idea is that, when header consists of `table` key, the header section
will be redendered the same way as content section. A map mapping each
placeholder name to the HEADER entry name is used for the context of the header.

Unit tests have been updated and added to cover the changes.

This fix is related to #28313.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9dda1155f3
Component: cli
2017-02-10 19:34:50 -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
9ac6e27b96 Add = before the value of PublishedPort
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
Upstream-commit: 04bea16969
Component: cli
2017-02-10 14:53:18 +08:00
b9c1f91e08 print 'worker' join token after swarm init
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 9e940b9020
Component: cli
2017-02-09 14:54:05 -08:00
5d377f6184 Merge pull request #30776 from WeiZhang555/stats-all-format-name-panic-cli
Fix panic of "docker stats --format {{.Name}} --all"
Upstream-commit: 487c3488fe
Component: cli
2017-02-08 11:40:06 -08:00
ee6a54e8c3 Fix panic of "docker stats --format {{.Name}} --all"
This commit fixes panic when execute stats command:

* use --format {{.Name}} with --all when there're exited containers.
* use --format {{.Name}} while stating exited container.

The root cause is when stating an exited container, the result from the
api didn't contain the Name and ID field, which will make format
process panic.

Panic log is like this:

```
panic: runtime error: slice bounds out of range [recovered]
	panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0xb20f80, 0xc420014110)
	/usr/local/go/src/runtime/panic.go:500 +0x1a1
text/template.errRecover(0xc4201773e8)
	/usr/local/go/src/text/template/exec.go:140 +0x2ad
panic(0xb20f80, 0xc420014110)
	/usr/local/go/src/runtime/panic.go:458 +0x243
github.com/docker/docker/cli/command/formatter.(*containerStatsContext).Name(0xc420430160,
0x0, 0x0)
	/go/src/github.com/docker/docker/cli/command/formatter/stats.go:148
+0x86
reflect.Value.call(0xb9a3a0, 0xc420430160, 0x2213, 0xbe3657, 0x4,
0x11bc9f8, 0x0, 0x0, 0x4d75b3, 0x1198940, ...)
	/usr/local/go/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0xb9a3a0, 0xc420430160, 0x2213, 0x11bc9f8, 0x0, 0x0,
0xc420424028, 0xb, 0xb)
	/usr/local/go/src/reflect/value.go:302 +0xa4
text/template.(*state).evalCall(0xc420177368, 0xb9a3a0, 0xc420430160,
0x16, 0xb9a3a0, 0xc420430160, 0x2213, 0x1178fa0, 0xc4203ea330,
0xc4203de283, ...)
	/usr/local/go/src/text/template/exec.go:658 +0x530
```

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 758383200e
Component: cli
2017-02-08 10:26:52 +08:00
d4d38719f1 Merge pull request #30790 from vdemeester/pr-30602
Carry #30602 : Bump go-units
Upstream-commit: b5a74e23ab
Component: cli
2017-02-08 11:04:22 +09:00
bb64592fc8 Merge pull request #30457 from dmcgowan/distribution-reference-update-2
reference: use distribution reference and remove fork
Upstream-commit: 326583e728
Component: cli
2017-02-07 22:01:25 +01:00
d81f14e15b Bump go-units
To include  https://github.com/docker/go-units/pull/23
Fixes a unit test that fails because of it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6ef0b64945
Component: cli
2017-02-07 21:58:56 +01:00
78cba3d0ad Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 635d686a88
Component: cli
2017-02-07 11:08:37 -08:00
5097259d19 Make sure we validate simple syntax on service commands
We ignored errors for simple syntax in `PortOpt` (missed that in the
previous migration of this code). This make sure we don't ignore
`nat.Parse` errors.

Test has been migrate too (errors are not exactly the same as before
though -_-)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6f8f1d20a2
Component: cli
2017-02-07 12:45:47 +01:00
b7b7587759 Merge pull request #30749 from yongtang/28005-docker-stats-header-windows
Fix Windows `docker stats` showing Linux headers
Upstream-commit: 6d194cd68d
Component: cli
2017-02-06 14:09:23 -08:00