Commit graph

897 commits

Author SHA1 Message Date
Vincent Demeester
663f0ba1b2 Merge pull request #32248 from icapurro/cli-image-tests
Unit tests for cli/command/image package
2017-04-24 17:01:26 +02:00
John Howard
c22b21fede Merge pull request #32731 from hairyhenderson/one-line-swarm-join-output-32725
Output `docker swarm join` command on a single line when running `docker swarm init`
2017-04-24 09:53:16 -05:00
Ignacio Capurro
b2551c619d Unit tests for cli/commands/image (except build and tag)
Signed-off-by: Ignacio Capurro <icapurrofagian@gmail.com>
2017-04-23 12:27:39 -05:00
Vincent Demeester
bb5dfdb8c5 Merge pull request #32632 from ColinHebert/compose_add_labels_during_build
Add support for labels during build with compose
2017-04-21 10:16:48 +02:00
Dave Henderson
50368e7a0e
Output docker swarm join on a single line
This avoids issues when copy/pasting between different shells on
different OSes, which may not all support `\` as a continuation
character.

Fixes #32725

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2017-04-20 07:18:25 -05:00
Vincent Demeester
3f676c1918
Fix formatter unit test (moving to testify)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-17 17:32:52 +02:00
Daniel Nephin
1eec7b5583 Merge pull request #32614 from aaronlehmann/testify
Remove pkg/testutil/assert in favor of testify
2017-04-17 11:07:08 -04:00
Sebastiaan van Stijn
a3ab46361e Merge pull request #30962 from TheHipbot/30431-implement-format-for-history-with-docs
30431 implement format for history with docs
2017-04-16 10:34:41 -07:00
Colin Hebert
bddd9cce40 Regenerate schema with the correct libraries
Signed-off-by: Colin Hebert <hebert.colin@gmail.com>
2017-04-15 13:00:23 +10:00
Colin Hebert
0ee58cb3b9 Run go generate github.com/docker/docker/cli/compose/schema
Signed-off-by: Colin Hebert <hebert.colin@gmail.com>
2017-04-15 10:57:43 +10:00
Colin Hebert
1d1defa399 Add support for labels during build with compose
Signed-off-by: Colin Hebert <hebert.colin@gmail.com>
2017-04-15 05:31:28 +10:00
Aaron Lehmann
6052f2b396 Remove pkg/testutil/assert in favor of testify
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>
2017-04-14 12:03:21 -07:00
Aaron Lehmann
8a27758364 Hide zero-valued timestamps from service JSON
It was possible to see output like this:

        "UpdateStatus": {
            "State": "updating",
            "StartedAt": "2017-04-14T17:10:03.226607162Z",
            "CompletedAt": "1970-01-01T00:00:00Z",
            "Message": "update in progress"
        }

The timestamp fields were already changed to pointers, and left nil if
the timestamp value was zero. However the zero-value of a timestamp from
gRPC is different from the value Go considers to be zero. gRPC uses the
Unix epoch instead of Go's epoch. Therefore, check that the timestamp
does not match the Unix epoch.

Also, add " ago" to the timestamps as shown in "docker service inspect
--pretty", as they are shown as relative times.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-14 10:44:24 -07:00
Sebastiaan van Stijn
0b35ab1965 Merge pull request #31482 from ripcurld0/add_format_to_system_df
Add format to the docker system df command
2017-04-13 10:08:11 -07:00
Anusha Ragunathan
d40a17ffc2 Merge pull request #28923 from erikh/fix-copy
Fix copy API (`docker cp`, etc) uid/gid handling
2017-04-12 08:21:17 -07:00
Erik Hollensbe
8a7ff5ff74 daemon/archive.go: Fix copy routines to preserve UID.
This changes the long-standing bug of copy operations not preserving the
UID/GID information after the files arrive to the container.

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2017-04-12 10:33:19 +00:00
Anusha Ragunathan
3343653edb Merge pull request #32030 from ehazlett/any-runtime
Support Swarmkit Generic Task Runtime
2017-04-11 17:53:20 -07:00
Vincent Demeester
8a8c1961b5 Merge pull request #32059 from seriousben/support-dns-stack-file
add support for dns nameservers and search domains in stack files
2017-04-11 21:32:52 +02:00
Evan Hazlett
8c2c69d31e updates for review comments
- runtimeUrl -> type_url
- runtimes -> runtime

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-04-11 14:02:01 -04:00
Evan Hazlett
f71bdc67a2 filter services by runtime; default to container
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-04-11 14:02:01 -04:00
Sebastiaan van Stijn
a258ef58d8 Merge pull request #32284 from aaronlehmann/fix-service-defaults
Improve default handling for "service create"
2017-04-11 13:06:53 +02:00
Victor Vieux
18ae574cab Merge pull request #32496 from tonistiigi/build-target
builder: add an option for specifying build target
2017-04-10 19:02:21 -07:00
Victor Vieux
17a3e4511d Merge pull request #32462 from dperny/service-logs-general-availability
Remove experimental from service logs
2017-04-10 18:30:20 -07:00
Victor Vieux
3a9572ca14 Merge pull request #32110 from adshmh/30977-stack-rm-should-accept-multiple-labels
stack rm should accept multiple arguments
2017-04-10 18:19:59 -07:00
Benjamin Boudreau
6b60a60729
Adding support for dns in stack files
Signed-off-by: Benjamin Boudreau <boudreau.benjamin@gmail.com>
2017-04-10 20:46:33 -04:00
Tonis Tiigi
33e07f41ad builder: add an option for specifying build target
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-04-10 16:21:43 -07:00
Sebastiaan van Stijn
ec207ce186 Merge pull request #32116 from mkumatag/inspect_template
Adopt text/template in node inspect
2017-04-10 23:02:26 +02:00
Aaron Lehmann
bbe1202410 Make the CLI show defaults from the swarmkit defaults package
If no fields related to an update config or restart policy are
specified, these structs should not be created as part of the service,
to avoid hardcoding the current defaults.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-10 13:41:18 -07:00
Aaron Lehmann
1d274e9acf Change "service inspect" to show defaults in place of empty fields
This adds a new parameter insertDefaults to /services/{id}. When this is
set, an empty field (such as UpdateConfig) will be populated with
default values in the API response. Make "service inspect" use this, so
that empty fields do not result in missing information when inspecting a
service.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-10 13:41:16 -07:00
Drew Erny
306cfecc8c Remove experimental from service logs
Service logs API is now stable. Service logs now support all features,
except retrieving details provided to the log driver.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-04-10 13:40:45 -07:00
Vincent Demeester
778e32a2fa Merge pull request #31236 from tonistiigi/docker-stdin
build: accept -f - to read Dockerfile from stdin
2017-04-10 20:14:54 +02:00
Sebastiaan van Stijn
5b1cae2271 Merge pull request #31148 from yongtang/31032-NanoCPU-update
Add `--cpus` support for `docker update`
2017-04-10 20:02:15 +02:00
Vincent Demeester
4460312ce1 Merge pull request #30740 from yongtang/29999-prune-filter-label
Add `label` filter for `docker system prune`
2017-04-10 19:38:01 +02:00
Daniel Nephin
a5b9d99b9e Merge pull request #32427 from adshmh/add-unit-tests-to-cli-command-idresolver-package
Added unit tests to the cli/command/idresolver package
2017-04-10 12:41:09 -04:00
Manjunath A Kumatagi
5dbd6afb51 Adopt text/template in node inspect
Signed-off-by: Manjunath A Kumatagi <mkumatag@in.ibm.com>
2017-04-10 17:47:15 +05:30
Sebastiaan van Stijn
b0831acb09 Merge pull request #32062 from aaronlehmann/change-network-attachments
Support service network attachment changes
2017-04-10 12:49:28 +02:00
Boaz Shuster
985a9c7047 Add format to the docker system df command
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-04-10 13:04:03 +03:00
Sebastiaan van Stijn
2daa2b894c Merge pull request #31364 from adshmh/30935-use-encrypted-client-certificate-to-connect-to-a-docker-host
use an encrypted client certificate to connect to a docker daemon
2017-04-10 10:42:01 +02:00
Arash Deshmeh
32486385e6 Added unit tests to the cli/command/idresolver package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-04-07 23:23:39 -04:00
Victor Vieux
fc6d8fb94d Merge pull request #32409 from dnephin/support-consistency-params-in-compose
Add support for volume consistency in compose format
2017-04-07 17:26:50 -07:00
Aaron Lehmann
56f1da77c3 Show network names in "docker service inspect --pretty"
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-07 16:46:25 -07:00
Aaron Lehmann
b8e70747c6 cli: Deploying a compose file must use TaskTemplate.Networks
This is the non-deprecated field, and the one that can be changed in a
service update.

Since old daemon versions don't allow migrating from one field to the
other, make this conditional on the API version.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-07 16:46:25 -07:00
Aaron Lehmann
0f2669a638 cli: Allow service's networks to be updated
Resolve networks IDs on the client side.

Avoid filling in deprecated Spec.Networks field.

Sort networks in the TaskSpec for update stability.

Add an integration test for changing service networks.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-07 16:46:25 -07:00
Sebastiaan van Stijn
091b5e68ea Merge pull request #32339 from aluzzardi/selinux
services: Add support for Credential Spec and SELinux
2017-04-08 01:37:17 +02:00
Brian Goff
4a1a64c677 Merge pull request #32154 from dperny/refactor-logs
Refactor logs and support service logs with TTY
2017-04-07 18:06:50 -04:00
Andrea Luzzardi
89a995a9d7 services: Add support for Credential Spec and SELinux
- Defined "normalized" type for Credential Spec and SELinux
- Added --credential-spec to docker service create & update
- SELinux is API only at the time

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2017-04-07 11:30:54 -07:00
Daniel Nephin
ae27355b09 Add support for volume consistency in compose format.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-07 13:23:33 -04:00
Vincent Demeester
8b9d54c084 Merge pull request #32289 from adshmh/add-unit-tests-for-cli-command-secret-package
add unit tests for package cli/command/secret
2017-04-07 15:26:40 +02:00
Arash Deshmeh
603dd8b3b4 use an encrypted client certificate to connect to a docker daemon
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-04-07 01:50:51 -04:00
Drew Erny
1044093bb0 refactor logs and support service logs /w tty
Refactor container logs system to make communicating log messages
internally much simpler. Move responsibility for marshalling log
messages into the REST server. Support TTY logs. Pave the way for fixing
the ambiguous bytestream format. Pave the way for fixing details.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-04-06 17:54:11 -07:00