Commit Graph

84 Commits

Author SHA1 Message Date
29bb8562cc Fix external networks
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9da2602f38
Component: cli
2017-12-11 11:29:49 -05:00
f0f2c2b953 Add missing additionalProperties marker on mount definitions
Signed-off-by: Joffrey F <joffrey@docker.com>
Upstream-commit: 88bbaca294
Component: cli
2017-12-06 12:37:38 -08:00
31d8edcd80 Add shm_size property to build configuration in Compose schema
Signed-off-by: Joffrey F <joffrey@docker.com>
Upstream-commit: e49f14cf36
Component: cli
2017-12-06 12:34:12 -08:00
c898dfbd95 Support network.name in the compose schema.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d0b8aa7701
Component: cli
2017-12-06 10:05:24 -05:00
9818aadf77 Add unit tests on config/secret indempotence in stack deploy
Related PR : https://github.com/docker/cli/pull/509

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5ed399e588
Component: cli
2017-11-30 09:45:32 +01:00
2598a6cd6a Added support of Generic resources in compose file
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Upstream-commit: 1ff73f867d
Component: cli
2017-11-28 21:52:09 +01:00
34cc3d6434 Remove duplication for secrets / configs, combine 3.5 loader tests, remove extraneous error call, regenerate schema correctly
Signed-off-by: Ilya Sotkov <ilya@sotkov.com>
Upstream-commit: ec47003ecb
Component: cli
2017-11-22 13:41:16 +02:00
3d2eab6bf0 Add tests for secret.name in compose files.
Signed-off-by: Ilya Sotkov <ilya@sotkov.com>
Upstream-commit: 1f10b31017
Component: cli
2017-11-22 13:18:05 +02:00
2dae51fa3d Add secret.name and config.name in compose.
Signed-off-by: Ilya Sotkov <ilya@sotkov.com>
Upstream-commit: 4f7f3d2f61
Component: cli
2017-11-22 13:18:05 +02:00
c5471a4a0e Add isolation mode on service update/create and compose files
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: 47cf2ea683
Component: cli
2017-11-17 15:31:13 +01:00
7e12c15274 Preparing for compose schema v3.5
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: 787e30d57a
Component: cli
2017-11-17 15:30:32 +01:00
5aa9076d56 Add unit tests for some convert/service
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f1cc679618
Component: cli
2017-11-10 16:28:39 -05:00
50743f5357 Remove duplication in compose/convert
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a68c940f1a
Component: cli
2017-11-10 15:56:11 -05:00
a1783b999b Remove duplication in loader
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7bd26ed690
Component: cli
2017-11-10 15:56:11 -05:00
127d797434 Only warn on volume.external.name for version 3.4
Also remove use of volume.external.name

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: aea9544db5
Component: cli
2017-11-06 17:04:36 -05:00
c5ffc78d5e Preserve sort-order of extra hosts, and allow duplicate entries
Extra hosts (`extra_hosts` in compose-file, or `--hosts` in services) adds
custom host/ip mappings to the container's `/etc/hosts`.

The current implementation used a `map[string]string{}` as intermediate
storage, and sorted the results alphabetically when converting to a service-spec.

As a result, duplicate hosts were removed, and order of host/ip mappings was not
preserved (in case the compose-file used a list instead of a map).

According to the **host.conf(5)** man page (http://man7.org/linux/man-pages/man5/host.conf.5.html)

    multi  Valid values are on and off.  If set to on, the resolver
      library will return all valid addresses for a host that
      appears in the /etc/hosts file, instead of only the first.
      This is off by default, as it may cause a substantial
      performance loss at sites with large hosts files.

Multiple entries for a host are allowed, and even required for some situations,
for example, to add mappings for IPv4 and IPv6 addreses for a host, as illustrated
by the example hosts file in the **hosts(5)** man page (http://man7.org/linux/man-pages/man5/hosts.5.html):

    # The following lines are desirable for IPv4 capable hosts
    127.0.0.1       localhost

    # 127.0.1.1 is often used for the FQDN of the machine
    127.0.1.1       thishost.mydomain.org  thishost
    192.168.1.10    foo.mydomain.org       foo
    192.168.1.13    bar.mydomain.org       bar
    146.82.138.7    master.debian.org      master
    209.237.226.90  www.opensource.org

    # The following lines are desirable for IPv6 capable hosts
    ::1             localhost ip6-localhost ip6-loopback
    ff02::1         ip6-allnodes
    ff02::2         ip6-allrouters

This patch changes the intermediate storage format to use a `[]string`, and only
sorts entries if the input format in the compose file is a mapping. If the input
format is a list, the original sort-order is preserved.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: dbdf8f6468
Component: cli
2017-10-30 01:48:09 +01:00
2af9de07de Fix load order
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: af8f563922
Component: cli
2017-10-05 12:03:29 -04:00
cf634f106b Cast interpolated values
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 18ddec447a
Component: cli
2017-10-04 17:36:47 -04:00
691ff82d89 Update interface of Interpolate
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0aa7ca943c
Component: cli
2017-10-04 17:36:43 -04:00
7125e1b239 Support parsing of named pipes for compose volumes.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9f73b8c718
Component: cli
2017-09-26 11:24:23 -04:00
95b34532ce Fix loader error with different build syntax
`build: .` was not working anymore. Fixing this by adding a new
tranform function for BuildConfig.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0da9f14821
Component: cli
2017-09-20 14:02:33 +02:00
13c06c5996 Tidying up compose/loader test a bit
- Use `require` instead of `assert` when the assumption is "breaking" for the code
following. For example when asserting an error is not nil and then doing
`err.Error` on it ; if `err` is nil, the test will panic instead of fail.
- Use `assert.Len` when possible. The error message is better.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f34655ecf8
Component: cli
2017-09-19 16:48:52 +02:00
2a72ee1fde Merge pull request #509 from xificurC/fix-secrets-and-configs-idempotence
sort secrets and configs to ensure idempotence
Upstream-commit: a09a2c6d15
Component: cli
2017-09-15 15:43:59 +02:00
7742f2c56c Merge pull request #481 from cdrage/add-build-to-service-config
Add 'build' to types.go
Upstream-commit: 2eb31e6b60
Component: cli
2017-09-13 18:20:42 +02:00
f7e5e8fdc8 Add 'build' to types.go
This adds 'build' to types.go in order for projects that use docker/cli
to parse Docker Compose files to correctly retrieve `build` keys

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Upstream-commit: 9bdb0763b9
Component: cli
2017-09-13 10:47:17 -04:00
b363a8f8a7 sort secrets and configs to ensure idempotence
`docker stack deploy` keeps restarting services it doesn't need to (no changes)
because the entries' order gets randomized at some previous (de)serialization.
Maybe it would be worth looking into this at a higher level and ensure
all (de)serialization happens in an ordered collection.

This quick fix sorts secrets and configs (in place, mutably) which ensures the
same order for each run.

Based on
https://github.com/moby/moby/pull/30506

Fixes
https://github.com/moby/moby/issues/34746

Signed-off-by: Peter Nagy <xificurC@gmail.com>
Upstream-commit: 27e8bdf32b
Component: cli
2017-09-08 16:09:48 +02:00
4bafd44516 updated vendoring
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: a0113c3a44
Component: cli
2017-09-01 19:41:06 -04:00
8bf4dec055 Merge pull request #475 from AliyunContainerService/start_period
Support start_period for healthcheck in Docker Compose
Upstream-commit: e636a5388c
Component: cli
2017-08-30 14:11:43 -04:00
8be8bd8ae1 Merge pull request #477 from dnephin/some-tests-for-container-command
A few tests for container command
Upstream-commit: 8ea02f6f08
Component: cli
2017-08-30 09:38:38 -07:00
73cf62aaae Change the type of interval, timeout and start_period of healthcheck from string to * time.Duration
Signed-off-by: Li Yi <denverdino@gmail.com>
Upstream-commit: e02fcfd34e
Component: cli
2017-08-30 23:39:12 +08:00
811eac4392 Reduce complexity in cli/command/container
Add tests for exec and cleanup existing tests.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e7f90b6b38
Component: cli
2017-08-29 19:25:50 -04:00
853b31143d Add ulimits to unsupported compose fields.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: bdc8cf364e
Component: cli
2017-08-29 17:05:16 -04:00
a4cd4da158 Support start_period for healthcheck in Docker Compose
Signed-off-by: Li Yi <denverdino@gmail.com>
Upstream-commit: 0abdad615f
Component: cli
2017-08-29 11:19:29 +08:00
83dbde2057 Reduce complexity of two formatters
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d318c4112b
Component: cli
2017-08-28 12:49:07 -04:00
0458d1b8d1 Merge pull request #452 from dnephin/compose-allow-x-fields
Allow extension fields in the v3.4 version of the compose format
Upstream-commit: d83752cdf2
Component: cli
2017-08-25 12:37:47 -04:00
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
01f2e768d7 Use new internal testutil.ErrorContains()
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 846a31aa50
Component: cli
2017-08-22 10:14:25 -04: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
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
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
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
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
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
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
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
f397c29ebe on_failure -> on-failure in compose code
on_failure should be on-failure

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Upstream-commit: d3f9a6c610
Component: cli
2017-06-28 11:10:02 -04:00
2b68a9d068 Use compose volume spec parser for container volume flag
Restore testcases for Volume spec parsing.
And correctly interpret the parsed volume.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 732261f774
Component: cli
2017-06-21 11:16:04 -04:00
49c6d18b80 Some improvements to compose volume spec parsing
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: db6ff357a7
Component: cli
2017-06-21 11:13:52 -04:00
b88ae58881 Add gosimple lint
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3724fb7f37
Component: cli
2017-06-14 16:55:08 -07:00