Commit Graph

289 Commits

Author SHA1 Message Date
Daniel Nephin dae1b7112c Remove test for code not in this repo.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-29 13:19:28 -04:00
Daniel Nephin d318c4112b Reduce complexity of two formatters
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-28 12:49:07 -04:00
Vincent Demeester 7e52344cd2 Merge pull request #471 from cyli/surface-autolock
Include whether the managers in the swarm are autolocked as part of `docker info`
2017-08-28 17:46:09 +02:00
Ying Li 3428b78e96 Include whether the managers in the swarm are autolocked as part of `docker info`.
Signed-off-by: Ying Li <ying.li@docker.com>
2017-08-25 16:33:46 -07:00
Daniel Nephin d83752cdf2 Merge pull request #452 from dnephin/compose-allow-x-fields
Allow extension fields in the v3.4 version of the compose format
2017-08-25 12:37:47 -04:00
Vincent Demeester 8ebc03a71f Merge pull request #367 from kolyshkin/ipcmode
Introduce/document new IPC modes
2017-08-25 09:48:00 +02:00
Tibor Vass 6c3d93bbb6 Merge pull request #445 from dnephin/add-end-to-end-suite
Add end to end suite
2017-08-23 16:16:09 -07:00
Daniel Nephin 05308fcec7 Merge pull request #440 from ripcurld0/search_format
Add --format to docker-search
2017-08-22 19:10:53 -04:00
Victor Vieux 5e1d0289f4 Merge pull request #456 from dnephin/add-tests-for-client
Add unit tests for initializing the client
2017-08-22 16:08:36 -07:00
Boaz Shuster 88cc47ad5c Add --format to docker-search
Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-08-23 01:37:54 +03:00
Daniel Nephin 79ecfa876b Merge pull request #463 from dnephin/remove-pkg-testutil
Remove docker/docker/pkg/testutil
2017-08-22 13:53:03 -04:00
Marco Mariani 3a0b967c05 support --compose-file - as stdin
Signed-off-by: Marco Mariani <marco.mariani@alterway.fr>
2017-08-22 17:55:59 +02:00
Daniel Nephin 2a1857e899 Allow extension fields in the v3.4 version of the compose format.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-22 10:42:49 -04:00
Vincent Demeester 317b735573 Merge pull request #439 from ripcurld0/fix_image_ls_digest
Show images digests when "{{.Digest}}" is in format
2017-08-22 16:17:43 +02:00
Daniel Nephin 846a31aa50 Use new internal testutil.ErrorContains()
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-22 10:14:25 -04:00
Daniel Nephin b3f843afe2 Move internal/test package out of cli.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-22 10:14:25 -04:00
Boaz Shuster 83112f6343 Show images digests when "{{.Digest}}" is in format
This patch fixes the following bug:

Running "docker image ls --digests" will add images digests
to the image table. However, when using "format" to display
images digests all of them are "<none>".

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-08-22 16:55:10 +03:00
Vincent Demeester 8da1daeefa Merge pull request #386 from thaJeztah/fix-image-resolve-detection
Fix image resolve detection
2017-08-22 15:05:39 +02:00
Christophe Vidal 037029414d Dropped hyphen in bind mount where appropriate
Signed-off-by: Christophe Vidal <kriss@krizalys.com>
2017-08-19 21:14:48 +07:00
Sebastiaan van Stijn 3c7ede6a68 Merge pull request #205 from redpanda/rollback
Add 'docker service rollback' subcommand
2017-08-19 15:56:14 +02:00
Daniel Nephin 930f97dd09 Add unit tests for initializing the client.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-18 12:49:23 -04:00
Joffrey F 1667073908 Update schemas to prevent invalid properties in deploy.resources
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-08-17 15:58:51 -07:00
Jimmy Leger 11d471d660 Add 'docker service rollback' subcommand
Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Implement runRollback to not use runUpdate

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Add version tag and add flag quiet to suppress progress output

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Removed flags from warnDetachDefault

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Used command.Cli interface

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Add detach flag on rollback command

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Create a fakeClient for service commands

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Added unit test for rollback command

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Used command.Cli interface instead of *command.DockerCli in service commands

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Revert "Removed flags from warnDetachDefault"

This reverts commit 3e4f601c8a82cc2599a755dc693409bbc47917fc.

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Fixed test.NewFakeCli instanciation

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Removed unused receiver

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Replaced cli by dockerCli

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Revert "Removed unused receiver"

This reverts commit 604ef7c13df3d019949ca81d992db501114dafce.

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Fixed last typo

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>
2017-08-16 22:18:36 +02:00
Daniel Nephin 15837afa77 Replace pkg/testutil/tempfile with gotestyourself/fs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 505a0fe45f Update volume command tests to use the new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 3d68aa8416 Update swarm command tests to use the new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 1dd742eac8 Update stack and task command tests to new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 4c62d7288f Update service and secret command tests to new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 0e2bf7420a Update node command tests to the new golden
Also remove some superfluous tests that are now covered by a strict golden.Assert

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:15 -04:00
Daniel Nephin 75f7bfedf8 Update image command tests to use the new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:20:36 -04:00
Daniel Nephin f9007ad7db Update config and checkpoint commands to use gotestyourself/golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:19:00 -04:00
Daniel Nephin b5cb5ee446 Add first e2e test
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 10:46:40 -04:00
Sebastiaan van Stijn 04659b8802 Merge pull request #430 from dnephin/add-build-target-to-compose
Add network and target to build in v3.4
2017-08-15 19:20:49 +02:00
Daniel Nephin 3b8cf20a0c Merge pull request #436 from thaJeztah/improve-singular-plural-message
Singularize / pluralize "argument(s)" in error message
2017-08-14 11:06:25 -04:00
Sebastiaan van Stijn 898f1e2997 Merge pull request #438 from ripcurld0/history_fix
Print timestamp when --human=true
2017-08-14 16:02:04 +02:00
Vincent Demeester aaf6939679 Merge pull request #390 from thaJeztah/add-test-for-github-special-case
Add test for github.com special handling
2017-08-14 10:24:13 +02:00
Boaz Shuster 5e7f0f67a8 Print timestamp when --human=true
* Setting "--human=true" changes "CreatedSince" format

* "CreatedAt" now displays the creation timestamp as
  specified in the documents

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-08-12 23:12:47 +03:00
Sebastiaan van Stijn b9a7f35e02
Singularize / pluralize "argument(s)" in error message
The validation functions to test for the number of passed arguments did not
pluralize `argument(s)`, and used `argument(s)` in all cases.

This patch adds a simple `pluralize()` helper to improve this.

Before this change, `argument(s)` was used in all cases:

    $ docker container ls foobar
    "docker container ls" accepts no argument(s).

    $ docker network create one two
    "docker network create" requires exactly 1 argument(s).

    $ docker network connect
    "docker network connect" requires exactly 2 argument(s).

    $ docker volume create one two
    "docker volume create" requires at most 1 argument(s).

After this change, `argument(s)` is properly singularized or plurarized:

    $ docker container ls foobar
    "docker container ls" accepts no arguments.

    $ docker network create one two
    "docker network create" requires exactly 1 argument.

    $ docker network connect
    "docker network connect" requires exactly 2 arguments.

    $ docker volume create one two
    "docker volume create" requires at most 1 argument.

Test cases were updated accordingly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-12 18:25:38 +02:00
Daniel Nephin eef256943b Add network and target to build in v3.4
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 10:50:32 -04:00
Daniel Nephin f3c325f390 Merge pull request #427 from vdemeester/import-templates-from-docker-pkg
Import templates from docker pkg
2017-08-08 11:55:58 -04:00
Vincent Demeester a6800f95fa
Import `docker/docker/pkg/templates` to cli
This package will be deprecated/removed from `docker/docker/pkg` and
is mainly used for the cli format options. Let's import it and
maintain here.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-08-08 17:26:24 +02:00
Kir Kolyshkin 9285db6752 Introduce/document new IPC modes
This builds (and depends) on https://github.com/moby/moby/pull/34087

Version 2:
 - remove --ipc argument validation (it is now done by daemon)
 - add/document 'none' value
 - docs/reference/run.md: add a table with better modes description
 - dockerd(8) typesetting fixes

Version 3:
 - remove ipc mode tests from cli/command/container/opts_test.go

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-08-05 17:49:53 -07:00
Sebastiaan van Stijn d0bea64185
Preserve resolved image-digest if QueryRegistry == false
When re-deploying a stack without re-resolving the image digest,
the service's ContainerSpec was updated with the image-reference
as specified in the stack/compose file.

As a result, the image-digest that was resolved in a previous
deploy was overwritten, causing the service to be re-deployed.

This patch preserves the previously resolve image-digest
by copying it from the current service spec.

A unit test is also added to verify that the image information
in the service spec is not updated if QueryRegistry is disabled.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-03 18:49:07 +02:00
Sebastiaan van Stijn f007d623a8
Add test for github.com special handling
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-03 17:53:42 +02:00
Josh Hawn 2831a04cba Enable TCP Keep-Alive in Docker client
Some network environments may have NATs, proxies, or gateways which
kill idle connections. There are many Docker API operations which may
be idle for long periods of time (such as ContainerWait and ContainerAttach)
and may result in unexpected connection closures or hangs if TCP keepalives
are not used.

This patch updates the default HTTP transport used by the Docker client
package to enable TCP Keep-Alive with a keep-alive interval of 30 seconds.
It also sets a connect timeout of 30 seconds.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2017-08-02 14:35:03 -07:00
Sebastiaan van Stijn 1cd402b192 Merge pull request #360 from akalipetis/compose-update-order
Add support for update order in compose deployments
2017-08-01 22:24:48 +02:00
Sebastiaan van Stijn ceb18a841a
Fix presentation of published "random" host ports
Ports that were picked from the ephemeral port range
were presented as `*:0->80/tcp`.

This patch changes the presentation to use the
actually assigned port, instead of the port specified
in `Endpoint.Spec` (which is always empty/zero (`0`))

Before this change;

    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    5d44i665qj66        with-random-port    replicated          1/1                 nginx:alpine        *:0->80/tcp

After this change;

    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    5d44i665qj66        with-random-port    replicated          1/1                 nginx:alpine        *:30000->80/tcp

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-01 19:21:17 +02:00
Vincent Demeester f386d476ba Merge pull request #388 from christopherobin/feature/stopsignal
Add support for stop-signal in stack command
2017-08-01 09:53:13 +02:00
Antonis Kalipetis 2950667f07
Support the "order" key in "update_config" for compose
Signed-off-by: Antonis Kalipetis <akalipetis@gmail.com>
2017-07-28 22:50:55 +03:00
Sebastiaan van Stijn eed14e840c Merge pull request #387 from darrenstahlmsft/saveFastFail
Fast fail when save directory does not exist
2017-07-28 17:46:13 +01:00