Commit Graph

23 Commits

Author SHA1 Message Date
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
0f057e3c8d Fix parsing resources from compose file for stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c2f0402f4d
Component: cli
2017-01-09 14:22:02 -05:00
ec2f9bcbe4 *: use opencontainers/go-digest package
The `digest` data type, used throughout docker for image verification
and identity, has been broken out into `opencontainers/go-digest`. This
PR updates the dependencies and moves uses over to the new type.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 5d67ac20cb
Component: cli
2017-01-06 18:48:41 -08:00
6a9af71e6e Replace vendor of aanand/compose-file with a local copy.
Add go-bindata for including the schema.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 52c0157036
Component: cli
2016-12-27 16:17:24 -05:00
84caa86071 Improve validation for volume specs
The current validation only checked for the
number of elements in the volume-spec, however,
did not validate if the elements were empty.

Because of this, an empty volume-spec (""),
or volume spec only containing separators ("::")
would not be invalidated.

This adds a simple check for empty elements in
the volume-spec, and returns an error if
the spec is invalid.

A unit-test is also added to verify the behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1f57f07070
Component: cli
2016-12-19 01:50:08 +01:00
58f845701a fix conversion of anonymous volumes in compose-file
the `convertVolumeToMount()` function did not take
anonymous volumes into account when converting
volume specifications to bind-mounts.

this resulted in the conversion to try to
look up an empty "source" volume, which
lead to an error;

    undefined volume:

this patch distinguishes "anonymous"
volumes from bind-mounts and named-volumes,
and skips further processing if no source
is defined (i.e. the volume is "anonymous").

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bc4590fd7d
Component: cli
2016-12-18 16:50:32 +01:00
49a03faa44 Move pkg to cli/compose/convert
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c4ea22972f
Component: cli
2016-12-16 12:27:31 -05:00