Commit Graph

56 Commits

Author SHA1 Message Date
ff2a4eeb5b Make sure we error out instead of panic during interpolation
Use type assertion to error out if the type isn't the right one
instead of panic as before this change.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: fe19bc6891
Component: cli
2017-03-23 16:09:57 +01:00
0c575acb31 Remove compose types.Dict alias
It is just an alias type and make the code a little bit more complex
and hard to use from outside `compose` package.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a1e1ab78d0
Component: cli
2017-03-22 16:16:20 +01:00
589b564e68 Fixing a small typo in compose loader package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 4826a5c3af
Component: cli
2017-03-20 15:39:57 +01:00
7332a7a5de Merge pull request #30781 from AkihiroSuda/fix-stack-env
compose: fix environment interpolation from the client
Upstream-commit: 6e24fc3f58
Component: cli
2017-03-17 15:56:50 +01:00
abd145043b compose: update the comment about MappingWithEquals
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 2fc6cd4b71
Component: cli
2017-03-17 06:21:55 +00:00
540d48f844 Merge pull request #31896 from aaronlehmann/move-secretrequestoption
api: Remove SecretRequestOption type
Upstream-commit: 2222824fd9
Component: cli
2017-03-16 21:31:15 +01:00
8698efadf8 api: Remove SecretRequestOption type
This type is only used by CLI code. It duplicates SecretReference in the
types/swarm package. Change the CLI code to use that type instead.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 395081fc6b
Component: cli
2017-03-16 11:20:31 -07:00
db27025447 Fix compose schema id for v3.2
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d0fb25319b
Component: cli
2017-03-16 13:53:58 -04:00
59194c0035 Merge pull request #31302 from dnephin/purge-orphaned-services
Add --prune to stack deploy
Upstream-commit: 69b7bf5e9f
Component: cli
2017-03-15 12:57:06 +01:00
648426f723 Merge pull request #31147 from adshmh/30629-print-escaping-hint-on-invalid-interpolation-format
docker stack deploy interpolation format error due to not escaping $ now includes a hint
Upstream-commit: d510306bb7
Component: cli
2017-03-14 17:14:09 -07:00
0ed0e112c4 Add --prune to stack deploy.
Add to command line reference.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b1a98b55af
Component: cli
2017-03-14 16:09:28 -04:00
63bca6acc7 Fix environment resolving.
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: 146d3eb304
Component: cli
2017-03-14 16:00:43 -04:00
85cd81c04a compose: fix environment interpolation from the client
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: b7ffa960bf
Component: cli
2017-03-14 15:59:40 -04:00
72f1866047 Merge pull request #31795 from dnephin/compose-file-v3.2
Compose file v3.2
Upstream-commit: d1fc5acc2e
Component: cli
2017-03-14 14:10:24 -04:00
fb5e1898c8 Merge pull request #30597 from dnephin/add-expanded-mount-format-to-stack-deploy
Add expanded mount format to stack deploy
Upstream-commit: b8c49df008
Component: cli
2017-03-14 17:53:28 +00:00
6f96d531a0 Add compose file version 3.2
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2e9b15143a
Component: cli
2017-03-13 16:20:42 -04:00
74ffacfbac Move endpoint_mode under deploy and add it to the schema.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 33bfb1e5e5
Component: cli
2017-03-13 15:00:56 -04:00
a4dea23f9c support both endpoint modes in stack
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: cd1cde6e77
Component: cli
2017-03-13 15:00:49 -04:00
c9cfbb4d45 Merge pull request #31176 from adshmh/29662-stack-deploy-error-if-external-combined-with-other-volume-options
stack deploy exits with error if both 'external' and other options are specified for a volume
Upstream-commit: 4c4af071c7
Component: cli
2017-03-11 01:59:43 +01:00
e6440da44a Merge pull request #31443 from james-nesbitt/export-more-compose-methods
exported add. cli compose loader parsing methods
Upstream-commit: 889f0259c2
Component: cli
2017-03-08 15:12:42 +01:00
ea19043c45 stack deploy exits with error if both 'external' and any other options are specified for volumes
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 789652c41a
Component: cli
2017-03-07 14:21:45 -05:00
22f2b40227 exported cli compose loader parsing methods
Signed-off-by: James Nesbitt <james.nesbitt@wunderkraut.com>
Upstream-commit: b6f45eb18e
Component: cli
2017-03-07 17:36:35 +02:00
19021e1a48 Convert new compose volume type to swarm mount type
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 63c3221dd3
Component: cli
2017-03-06 11:45:01 -05:00
53c21bb298 Support expanded mounts in Compose loader
Add a test for loading expanded mount format.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 29f39ea244
Component: cli
2017-03-06 11:45:01 -05:00
48d10d2797 Parse a volume spec on the client, with support for windows drives
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a442213b92
Component: cli
2017-03-06 11:45:01 -05:00
d9230d0bd1 Add expanded mount syntax to Compose schema and types.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d2d48f3f69
Component: cli
2017-03-06 11:45:01 -05:00
123d371946 Support customizing the default network for a stack.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5de7378cbe
Component: cli
2017-02-24 17:32:23 -05:00
ac3e9a7a54 docker compose interpolation format error now includes a hint on escaping $ characters.
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 3581bec442
Component: cli
2017-02-24 11:37:40 -05:00
ed5a89b79a Merge pull request #31088 from xulike666/make-code-readable-again
Typo fixed and this time I provide my cSpell.json
Upstream-commit: 7377abd9e0
Component: cli
2017-02-16 22:04:27 -05:00
405e82d675 Merge pull request #31006 from vdemeester/30991-secret-mode-in-stack-deploy
Set 0444 as default secret mode in stack deploy
Upstream-commit: 325c8823bc
Component: cli
2017-02-16 20:34:21 -05:00
6fa6de6703 why there are so many mistakes in our repo (up to /cmd)
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: ca2aeb5a3e
Component: cli
2017-02-17 00:32:48 +08:00
d2654dd0cc Set 0444 as default secret mode in stack deploy
Change the default secret mode to match the default one used in
`service` subcommands.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 645f6ba7f5
Component: cli
2017-02-16 11:26:05 +01:00
200980812d fix docker stack volume's nocopy parameter
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
Upstream-commit: 6887337d86
Component: cli
2017-02-15 19:46:27 +08:00
7cfd3076e4 Support expanded ports in Compose loader
This commit adds support for expanded ports in Compose loader,
and add several unit tests for loading expanded port format.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c53471254b
Component: cli
2017-02-07 09:14:56 -08:00
af8335c602 Add expanded port syntax to Compose schema and types.
This commit adds expanded port syntax to Compose schema and types
so that it is possible to have
```
ports:
  - mode: host
    target: 80
    published: 9005
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c69e0f7dd5
Component: cli
2017-02-07 09:12:55 -08:00
857a9c8722 Add compose support of attachable in networks
This fix tries to address the issue raised in 29975 where
it was not possible to specify `attachable` flag for networks
in compose format.

NOTE: Compose format aleady supports `labels` in networks.

This fix adds the support of `attachable` for compose v3.1 format.

Additiona unit tests have been updated and added.

This fix fixes 29975.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 1a677699ae
Component: cli
2017-02-04 14:16:06 -08:00
d08c0b0b1c Merge pull request #30506 from vdemeester/29732-follow-up-compose-indempotent
Make docker stack deploy a little bit more indempotent
Upstream-commit: 7b5071b028
Component: cli
2017-01-31 13:35:04 -08:00
d1dc107dc1 Remove the old loading system from compose config loading
The original Compose config loading used the `compose` tag, which
was replaced by mapstructure. Some fields were left on the old tag. This
commit removes the old tag and uses types and mapstructure.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 1eefdba226
Component: cli
2017-01-27 17:03:41 -05:00
30585d157d Make docker stack deploy a little bit more indempotent
Sort some slice fields before sending them to the swarm api so that it
won't trigger an update.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3df952523c
Component: cli
2017-01-27 16:09:02 +01:00
b4ed9a1ae0 Set default values for uid and gid to prevent errors when starting a service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 485a2b2b2f
Component: cli
2017-01-26 12:00:46 -05:00
ef211db9b6 Rebase Compose v3.1 schema on the latest v3 schema.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b0eabe7718
Component: cli
2017-01-26 11:33:15 -05:00
c63bb4b9c1 Test and fix external secrets in stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 682d75fa3f
Component: cli
2017-01-26 11:33:15 -05:00
a568e7cd60 Add integration test for stack deploy with secrets.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4a1c23bc26
Component: cli
2017-01-26 11:33:15 -05:00
5805451da4 Implement secret types for compose file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0382f4f365
Component: cli
2017-01-26 11:33:15 -05:00
fb3da331a1 Add v3.1 schema and support validating multiple version.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7215ebffa8
Component: cli
2017-01-26 11:33:15 -05:00
d47c7b7dfb Add missing network.internal.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3dd116fede
Component: cli
2017-01-20 12:53:19 -05:00
1d5659f53b Update Compose schema to match docker-compose.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: cd3c323c38
Component: cli
2017-01-20 12:36:57 -05:00
152258c49f Add error checking for hostPort range
This fix catches the case where there is a single container port
and a dynamic host port and will fail out gracefully
Example docker-compose.yml snippet:
    port:
        ports:
            - "8091-8093:8091"
            - "80:8080"

Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
Upstream-commit: 74c29fde04
Component: cli
2017-01-13 18:05:51 -05:00
711f69b565 Improve the error message for extends in stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 384611596b
Component: cli
2017-01-11 11:57:24 -05:00
4b2d2c595b Few stack deploy network fixes
- 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: 70643ad005
Component: cli
2017-01-10 10:29:09 +01:00