Commit Graph
1153 Commits
Author SHA1 Message Date
Victor Vieux 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
Krasi Georgiev f79fc0f81e ignore registry url from user when it is the default namespace
Signed-off-by: Krasi Georgiev <krasi@vip-consult.solutions>
Upstream-commit: 1d0e556669
Component: cli
2017-02-21 22:04:54 +02:00
Reficul 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
Sebastiaan van Stijn 8daaeb5db9 Merge pull request #30814 from YuPengZTE/devSwarmCliExplain
fix the type
Upstream-commit: 0eacd8a363
Component: cli
2017-02-21 00:59:58 +01:00
Tony Abboud 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
Tony Abboud 68022c25ce Add --add-host for docker build
Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
Upstream-commit: 1c579ffcc5
Component: cli
2017-02-20 17:32:28 -05:00
Victor Vieux 8176608bd2 add missing API changes
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 0d367623d0
Component: cli
2017-02-19 01:33:43 -08:00
Victor Vieux 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
Anusha Ragunathan 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
Alexander Morozov 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
Vincent Demeester 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
allencloud 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
Brian Goff 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
Nishant Totla 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
Brian Goff 405e82d675 Merge pull request #31006 from vdemeester/30991-secret-mode-in-stack-deploy
Set 0444 as default secret mode in stack deploy
Upstream-commit: 325c8823bc
Component: cli
2017-02-16 20:34:21 -05:00
Aaron.L.Xu 6416340b1c why there are so many mistakes in our repo (up to /cmd)
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: d5e4c0d0be
Component: cli
2017-02-17 00:32:48 +08:00
Aaron.L.Xu 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
Vincent Demeester 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
Vincent Demeester d2654dd0cc Set 0444 as default secret mode in stack deploy
Change the default secret mode to match the default one used in
`service` subcommands.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 645f6ba7f5
Component: cli
2017-02-16 11:26:05 +01:00
Alexander Morozov 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
bingshen.wbs 200980812d fix docker stack volume's nocopy parameter
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
Upstream-commit: 6887337d86
Component: cli
2017-02-15 19:46:27 +08:00
yupengzte 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
Brian Goff b92dc0df94 Merge pull request #30851 from chchliang/networktest
add testcase check connect.EndpointConfig not nil
Upstream-commit: d0602ae8d8
Component: cli
2017-02-13 10:58:02 -05:00
allencloud 7448bd1807 remove redundant colon introduced by mistake
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 2c8cac3bd6
Component: cli
2017-02-13 10:16:57 +08:00
Vincent Demeester 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
Sebastiaan van Stijn bfe71dc0ac Merge pull request #30476 from yongtang/30447-port-config-long-syntax
Support expanded syntax of ports in `docker stack deploy`
Upstream-commit: ad5f8089c2
Component: cli
2017-02-11 11:13:54 -08:00
Yong Tang 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
Yong Tang 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
allencloud 1737a52139 remove redundant code and better error msg
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: bb22446a68
Component: cli
2017-02-11 09:22:07 +08:00
Yong Tang 0ea3cc9974 Additional experimental features in non-experimental mode error handling
This fix is the follow up of the last commit.
In this fix:
1. If any of the parents of a command has tags, then this command's
`Args` (Args validation func) will be wrapped up. The warpped up func
will check to see if the feature is supported or not. If it is not supported,
then a not supported message is generated instead.

This fix is related to 28626.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d5010088e3
Component: cli
2017-02-10 17:05:10 -08:00
Yong Tang bb163c30ef Improve error handling of experimental features in non-experimental mode
This fix tries to address several issues raised in 28626 where
run against a non-experimental daemon may not generate correct
error message:
1. Incorrect flags were not checked against the supported features:
   ```
   $ docker stack --nonsense
   unknown flag: --nonsense
   ```
2. Subcommands were not checked against the supported features:
   ```
   $ docker stack ls
   Error response from daemon: This node is not a swarm manager...
   ```

This fix address the above mentioned issues by:
1. Add a pre-check for FlagErrorFunc
2. Recursively check if a feature is supported for cmd and its parents.

This fix fixes 28626.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8e688f17a3
Component: cli
2017-02-10 16:54:19 -08:00
Yong Tang 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
allencloud c28cd54770 remove unused headers in secret_create.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: a8f833a646
Component: cli
2017-02-11 00:16:48 +08:00
Aaron.L.Xu 7cd5a4ceb5 review code about cmd/* and fix some easy typos :D
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: 0d8fd85842
Component: cli
2017-02-10 15:52:33 +08:00
yupengzte 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
Victor Vieux 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
chchliang 481e937f5b add test case check connect.EndpointConfig not nil
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: c5a66caf93
Component: cli
2017-02-09 11:26:20 +08:00
Alexander Morozov 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
Zhang Wei 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
Akihiro Suda 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
Vincent Demeester 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
Vincent Demeester 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
Derek McGowan 4e65e92118 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: b741d2e9b5
Component: cli
2017-02-07 11:08:37 -08:00
Derek McGowan 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
Yong Tang 7cfd3076e4 Support expanded ports in Compose loader
This commit adds support for expanded ports in Compose loader,
and add several unit tests for loading expanded port format.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c53471254b
Component: cli
2017-02-07 09:14:56 -08:00
Yong Tang af8335c602 Add expanded port syntax to Compose schema and types.
This commit adds expanded port syntax to Compose schema and types
so that it is possible to have
```
ports:
  - mode: host
    target: 80
    published: 9005
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c69e0f7dd5
Component: cli
2017-02-07 09:12:55 -08:00
Vincent Demeester 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
Alexander Morozov 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
Alexander Morozov c09e34c27e Merge pull request #30742 from yongtang/29975-compose-network-attachable
Add compose support of `attachable` in networks
Upstream-commit: a4cd8a978f
Component: cli
2017-02-06 12:27:44 -08:00
Alexander Morozov f84f745895 Merge pull request #30769 from tianon/prompt-for-confirmation
Fix "command.PromptForConfirmation" to accept "enter" for the "N" default
Upstream-commit: 3fd87661c7
Component: cli
2017-02-06 11:44:45 -08:00