I noticed that we're using a homegrown package for assertions. The
functions are extremely similar to testify, but with enough slight
differences to be confusing (for example, Equal takes its arguments in a
different order). We already vendor testify, and it's used in a few
places by tests.
I also found some problems with pkg/testutil/assert. For example, the
NotNil function seems to be broken. It checks the argument against
"nil", which only works for an interface. If you pass in a nil map or
slice, the equality check will fail.
In the interest of avoiding NIH, I'm proposing replacing
pkg/testutil/assert with testify. The test code looks almost the same,
but we avoid the confusion of having two similar but slightly different
assertion packages, and having to maintain our own package instead of
using a commonly-used one.
In the process, I found a few places where the tests should halt if an
assertion fails, so I've made those cases (that I noticed) use "require"
instead of "assert", and I've vendored the "require" package from
testify alongside the already-present "assert" package.
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 6052f2b3969feadb01662d8e2f30337d9c7f61af
Component: engine
This makes it work a little closer to compose part and it is more
correct 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ee08c8542aed078e06f1d9c559d62560e97f371d
Component: engine
Add to command line reference.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 644fd804fce63499812259331b0a9f2a4a3ebcc4
Component: engine
Load from env should only happen if the value is unset.
Extract a buildEnvironment function and revert some changes to tests.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a9c86b63c03fc3557748d7792c11041387cb93d9
Component: engine
For an environment variable defined in the yaml without value,
the value needs to be propagated from the client, as in Docker Compose.
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: ea43c33330ec9a1e9a9b8a85348c1757fdae65c4
Component: engine
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: f8c7c921d905615acf1d2c6577ae1cfb4600bec0
Component: engine
This fix tries to improve the display of `docker service ls`
and adds `--format` flag to `docker service ls`.
In addition to `--format` flag, several other improvement:
1. Updates `docker stacks service`.
2. Adds `servicesFormat` to config file.
Related docs has been updated.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 000f0403d9084e8da427bafac3b594a822b3c386
Component: engine
- Make sure we use the correct network name for external ones.
- Make the default network overridable and only creates networks that
are used by services — so that default network is only created if a
service doesn't declare a network.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3191f5809bc1233bbf2103d2432b75cac93567bb
Component: engine
Add go-bindata for including the schema.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f5af9b9738892b5988f987ce5fbce6e31a10e768
Component: engine
In #28507 and #28885, `docker service/node ps -a` has been removed so that
information about slots are show up even without `-a` flag.
The output of `docker stack ps` reused the same output as `docker service/node ps`.
However, the `-a` was still there. It might make sense to remove `docker stack ps -a`
as well to bring consistency with `docker service/node ps`.
This fix is related to #28507, #28885, and #25983.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9155e14e77a8235791a6de752f6f43e83308e23d
Component: engine
Add support for simple and complex syntax to `--publish` through the
use of `PortOpt`.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 75bf18c9f01d050e5fccab98fb671306c7c5f6d2
Component: engine
Logging configuration was completely ignore when deploy a compose file
to swarm. This fixes it.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 806cc1e0f815d7c4e4b7bd4fa537e3d4c3535e23
Component: engine
If the network is marked as external, don't use the namespace on
it. Otherwise, it's not found.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6fff8454099092780655e8a2c7d71402ce547c5c
Component: engine
network is `nil` if the following case:
```
services:
foo:
image: nginx
networks:
mynetwork:
```
It's a valid compose so we should not panic.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 158388ef8d66723ec1f8ee4770d7488948234d16
Component: engine
the service definition uses the format as defined
in http://man7.org/linux/man-pages/man5/hosts.5.html
(IP_address canonical_hostname [aliases...])
This format is the _reverse_ of the format used in
the container API.
Commit f32869d956eb175f88fd0b16992d2377d8eae79c
inadvertently used the incorrect order.
This fixes the order, and correctly sets it to;
IP-Address hostname
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f1b9df91722a229fd0cefd7a0868933b6b811544
Component: engine
Modify the service update and create APIs to return optional warning
messages as part of the response. Populate these messages with an
informative reason when digest resolution fails.
This is a small API change, but significantly improves the UX. The user
can now get immediate feedback when they've specified a nonexistent
image or unreachable registry.
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 948e60691e523022f88e7f8129f02106a0f8826c
Component: engine
`docker stack deploy` now supports a composefile v3 format that have a
healthcheck.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3bd64de7a9c3eecbd57cb11d861a6fe94a5bb788
Component: engine