Commit Graph

270 Commits

Author SHA1 Message Date
f71ceb67bc Allow extension fields in the v3.4 version of the compose format.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2a1857e899
Component: cli
2017-08-22 10:42:49 -04:00
243671339d Merge pull request #386 from thaJeztah/fix-image-resolve-detection
Fix image resolve detection
Upstream-commit: 8da1daeefa
Component: cli
2017-08-22 15:05:39 +02:00
31162a9a25 Dropped hyphen in bind mount where appropriate
Signed-off-by: Christophe Vidal <kriss@krizalys.com>
Upstream-commit: 037029414d
Component: cli
2017-08-19 21:14:48 +07:00
43172bf261 Merge pull request #205 from redpanda/rollback
Add 'docker service rollback' subcommand
Upstream-commit: 3c7ede6a68
Component: cli
2017-08-19 15:56:14 +02:00
6092fc343f Update schemas to prevent invalid properties in deploy.resources
Signed-off-by: Joffrey F <joffrey@docker.com>
Upstream-commit: 1667073908
Component: cli
2017-08-17 15:58:51 -07:00
cded911aad 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>
Upstream-commit: 11d471d660
Component: cli
2017-08-16 22:18:36 +02:00
55bd0229fa Replace pkg/testutil/tempfile with gotestyourself/fs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 15837afa77
Component: cli
2017-08-16 14:23:28 -04:00
34fe016d0d Update volume command tests to use the new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 505a0fe45f
Component: cli
2017-08-16 14:23:28 -04:00
a5b8c46809 Update swarm command tests to use the new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3d68aa8416
Component: cli
2017-08-16 14:23:28 -04:00
38bd6cfe47 Update stack and task command tests to new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 1dd742eac8
Component: cli
2017-08-16 14:23:28 -04:00
2c6a1a2476 Update service and secret command tests to new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4c62d7288f
Component: cli
2017-08-16 14:23:28 -04:00
79c79c9b8f 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>
Upstream-commit: 0e2bf7420a
Component: cli
2017-08-16 14:23:15 -04:00
c06d7f05e3 Update image command tests to use the new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 75f7bfedf8
Component: cli
2017-08-16 14:20:36 -04:00
5a6dec9ec1 Update config and checkpoint commands to use gotestyourself/golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f9007ad7db
Component: cli
2017-08-16 14:19:00 -04:00
850fb084cc Merge pull request #430 from dnephin/add-build-target-to-compose
Add network and target to build in v3.4
Upstream-commit: 04659b8802
Component: cli
2017-08-15 19:20:49 +02:00
133a5fd166 Merge pull request #436 from thaJeztah/improve-singular-plural-message
Singularize / pluralize "argument(s)" in error message
Upstream-commit: 3b8cf20a0c
Component: cli
2017-08-14 11:06:25 -04:00
2d6cf733e9 Merge pull request #438 from ripcurld0/history_fix
Print timestamp when --human=true
Upstream-commit: 898f1e2997
Component: cli
2017-08-14 16:02:04 +02:00
c5b1acac69 Merge pull request #390 from thaJeztah/add-test-for-github-special-case
Add test for github.com special handling
Upstream-commit: aaf6939679
Component: cli
2017-08-14 10:24:13 +02:00
44e937f3a9 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>
Upstream-commit: 5e7f0f67a8
Component: cli
2017-08-12 23:12:47 +03:00
7e214d1c8f 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>
Upstream-commit: b9a7f35e02
Component: cli
2017-08-12 18:25:38 +02:00
148a571829 Add network and target to build in v3.4
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: eef256943b
Component: cli
2017-08-09 10:50:32 -04:00
763e45c80b Merge pull request #427 from vdemeester/import-templates-from-docker-pkg
Import templates from docker pkg
Upstream-commit: f3c325f390
Component: cli
2017-08-08 11:55:58 -04:00
d19b8b0269 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>
Upstream-commit: a6800f95fa
Component: cli
2017-08-08 17:26:24 +02:00
814542744c 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>
Upstream-commit: d0bea64185
Component: cli
2017-08-03 18:49:07 +02:00
bf8164c7d6 Add test for github.com special handling
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f007d623a8
Component: cli
2017-08-03 17:53:42 +02:00
37d6377fa6 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)
Upstream-commit: 2831a04cba
Component: cli
2017-08-02 14:35:03 -07:00
ef1dcf60fa Merge pull request #360 from akalipetis/compose-update-order
Add support for update order in compose deployments
Upstream-commit: 1cd402b192
Component: cli
2017-08-01 22:24:48 +02:00
070da803ab 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>
Upstream-commit: ceb18a841a
Component: cli
2017-08-01 19:21:17 +02:00
b6625098a8 Merge pull request #388 from christopherobin/feature/stopsignal
Add support for stop-signal in stack command
Upstream-commit: f386d476ba
Component: cli
2017-08-01 09:53:13 +02:00
7fbda78591 Support the "order" key in "update_config" for compose
Signed-off-by: Antonis Kalipetis <akalipetis@gmail.com>
Upstream-commit: 2950667f07
Component: cli
2017-07-28 22:50:55 +03:00
236f3097a5 Merge pull request #387 from darrenstahlmsft/saveFastFail
Fast fail when save directory does not exist
Upstream-commit: eed14e840c
Component: cli
2017-07-28 17:46:13 +01:00
06bc641d46 Merge pull request #306 from lipingxue/new_compose_fix.liping
Make compose file allow to specify names for non-external volume
Upstream-commit: 75249123b1
Component: cli
2017-07-28 00:35:44 +02:00
337a036e64 Change to enable volume name can be customized.
Signed-off-by: Liping Xue <lipingxue@gmail.com>
Change to enable volume name can be customized.
Signed-off-by: Liping Xue <lipingxue@gmail.com>

Change to enable volume name can be customized.

Remove unused debug info.

Address comments from Daniel and solve the lint error.
Signed-off-by: Liping Xue <lipingxue@gmail.com>

Address Daniel's comments to print warning message when name of external volume is set in loader code.
Signed-off-by: Liping Xue <lipingxue@gmail.com>

Address Daniel's comments to return error when external volume is set in loader code.
Signed-off-by: Liping Xue <lipingxue@gmail.com>

Address Daniel's comments to return error when external volume is set in loader code.
Signed-off-by: Liping Xue <lipingxue@gmail.com>

Remove the case that specifying external volume name in full-example.yml.

More fix.

Add unit test.
Signed-off-by: Liping Xue <lipingxue@gmail.com>

Address comments from Daniel, move the schema change to v3.4.
Signed-off-by: Liping Xue <lipingxue@gmail.com>

Address comments from Sebastiaan. Signed-off-by: Liping Xue <lipingxue@gmail.com>

Address comments from Misty.
Signed-off-by: Liping Xue <lipingxue@gmail.com>
Upstream-commit: 27a3080825
Component: cli
2017-07-27 15:09:05 -07:00
3c0b1df0ba Fast fail when save directory does not exist
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 18c877d35c
Component: cli
2017-07-27 15:00:38 -07:00
5e49f90082 Add support for stop-signal in stack command
Signed-off-by: Christophe Robin <crobin@nekoo.com>
Upstream-commit: b129a70b5c
Component: cli
2017-07-27 13:18:05 +09:00
53b038fa76 Error if "until" filter is combined with "--volumes" on system prune
The "until" filter is supported by all object types, except for
volumes.

Before this patch, the "until" filter would attempted to be used for the volume
prune endpoint, resulting in an error being returned by the daemon, and
further prune endpoints (networks, images) to be skipped.

    $ docker system prune --filter until=24h --filter label=label.foo=bar

    WARNING! This will remove:
            - all stopped containers
            - all volumes not used by at least one container
            - all networks not used by at least one container
            - all dangling images
    Are you sure you want to continue? [y/N] y
    Error response from daemon: Invalid filter 'until'

    Calling POST /v1.30/containers/prune?filters=%7B%22label%22%3A%7B%22label.foo%3D%3Dbar%22%3Atrue%7D%2C%22until%22%3A%7B%2224h%22%3Atrue%7D%7D
    Calling POST /v1.30/volumes/prune?filters=%7B%22label%22%3A%7B%22label.foo%3D%3Dbar%22%3Atrue%7D%2C%22until%22%3A%7B%2224h%22%3Atrue%7D%7D
    Handler for POST /v1.30/volumes/prune returned error: Invalid filter 'until'
    Error response from daemon: Invalid filter 'until'

With this patch, an error is produced instead, preventing "partial" prune.

    $ docker system prune --filter until=24h --filter label=foo==bar --volumes
    ERROR: The "until" filter is not supported with "--volumes"

Note that `docker volume prune` does not have this problem, and produces an
error if the `until` filter is used;

    $ docker volume prune --filter until=24h

    WARNING! This will remove all volumes not used by at least one container.
    Are you sure you want to continue? [y/N] y
    Error response from daemon: Invalid filter 'until'

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3c095dc546
Component: cli
2017-07-21 12:11:53 +02:00
4ea813dca9 Merge pull request #364 from ksouf/issue-37-add-connect-disconnect
adding connect disconnect network tests
Upstream-commit: 36b9edff7e
Component: cli
2017-07-21 11:19:23 +02:00
1dd2821aa2 Merge pull request #357 from ripcurld0/nat_sort_service
Sort services names in a natural order
Upstream-commit: dfbad2bc5a
Component: cli
2017-07-20 22:56:09 +02:00
69533b66d7 adding connect disconnect network tests
Signed-off-by: khaled souf <khaled.souf@gmail.com>
Upstream-commit: 7296abf39f
Component: cli
2017-07-20 18:53:03 +02:00
0d67981907 Add myself to command/stack codeowners
Cleanup a test

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 60991e943b
Component: cli
2017-07-20 12:05:20 -04:00
82bb6886df Skip inspects of built-in networks on stack deploy
Signed-off-by: Alex Mavrogiannis <alex.mavrogiannis@docker.com>
Upstream-commit: 7f53c99dfe
Component: cli
2017-07-19 19:39:44 -07:00
0de63ac93f Add Compose format 3.4
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0adccacb38
Component: cli
2017-07-19 14:24:59 -07:00
c04822c682 Sort services names in a natural order
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 7478e47b2d
Component: cli
2017-07-19 18:18:06 +03:00
7c2dc55ca3 Remove unnecessary prune function aliases.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: ff350a04cb
Component: cli
2017-07-18 12:25:45 -04:00
c912542d4f Merge pull request #350 from thaJeztah/unexport-commands
Unexport subcommands
Upstream-commit: a14762c6d2
Component: cli
2017-07-18 17:17:01 +02:00
ea84db7e56 Unexport subcommands
These commands were only used as subcommands, so did
not have to be exported.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9c7b0d74cd
Component: cli
2017-07-18 15:26:45 +02:00
7e5b932e43 Small refactor in system prune
Adapt "image prune" and "build cache prune" to have
the same signature as the other prune commands, so
that they can all be added to the "pruneFuncs" array.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 73163ee78b
Component: cli
2017-07-18 15:13:11 +02:00
6250958cd7 Merge pull request #315 from ripcurld0/nat_sort
Sort swarm stacks and nodes using natural sorting
Upstream-commit: 79e4d635ca
Component: cli
2017-07-18 15:01:11 +02:00
6db8c53375 Merge pull request #345 from vdemeester/remove-prune-package
Remove useless prune package 👼
Upstream-commit: 19efbc85f4
Component: cli
2017-07-18 14:46:53 +02:00
8dbc530b62 Remove useless prune package 👼
The `cli/command/prune` just does some aliasing of `Prune*` methods,
doesn't have any use.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3f4d91508e
Component: cli
2017-07-18 09:49:02 +02:00