Commit Graph

18 Commits

Author SHA1 Message Date
johnharris85 6d2805917c Account for aliased links
Fix failing tests
Signed-off-by: John Harris <john@johnharris.io>
2016-04-17 15:25:06 -04:00
Aanand Prasad aeef61fcd8 Make 'version' a string
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-02-02 13:58:34 +00:00
Aanand Prasad a9c623fdf2 Test that net can be extended
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-25 23:55:20 +00:00
Aanand Prasad e566a4dc1c Implement network_mode in v2
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-25 23:24:55 +00:00
Dimitar Bonev 2f07e2ac36 Ulimits are now merged into extended services
Signed-off-by: Dimitar Bonev <dimitar.bonev@gmail.com>
2016-01-12 23:59:23 +02:00
Daniel Nephin 5e97b806d5 Fix a bug in ExtendsResolver where the service name of the extended service was wrong.
This bug can be seen by the change to the test case. When the extended service
uses a different name, the error was reported incorrectly.

By fixing this bug we can simplify self.signature and self.detect_cycles to
always use self.service_name.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-11 10:58:07 -05:00
Karol Duleba 91b227d133 Allow to extend service using shorthand notation. Closes #1989
Signed-off-by: Karol Duleba <mr.fuxi@gmail.com>
2015-09-24 18:01:47 +01:00
Mazz Mosley 950577d60f Split validation into fields and service
We want to give feedback to the user as soon as possible about the
validity of the config supplied for the services.

When extending a service, we can validate that the fields are
correct against our schema but we must wait until the *end* of
the extends cycle once all of the extended dicts have been merged
into the service dict, to perform the final validation check on the
config to ensure it is a complete valid service.

Doing this before that had happened resulted in false reports of
invalid config, as common config when split out, by itself, is not
a valid service but *is* valid config to be included.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-09-02 15:42:38 +01:00
Mazz Mosley 4a8b2947ca Interpolate extended config
This refactoring is now really coming together. Construction is
happening in the __init__, which is a constructor and helps
clean up the design and clarity of intent of the code. We can now
see (nearly) everything that is being constructed when a ServiceLoader
is created. It needs all of these data constructs to perform the
domain logic and actions. Which are now clearer to see and moving
more towards the principle of functions doing (mostly)one thing and
function names being more descriptive.

resolve_extends is now concerned with the resolving of extends, rather
than the construction, validation, pre processing and *then* resolving
of extends.

Happy days :)

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-09-02 15:42:38 +01:00
Mazz Mosley 36757cde1c Validate extended service against our schema
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-09-02 15:42:38 +01:00
Daniel Nephin 59d4f304ee Run pre-commit on all files
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-08-24 17:04:50 -04:00
Karol Duleba 2e7f08c2ef Raise configuration error when trying to extend service that does not exist. Fixes #1826
Signed-off-by: Karol Duleba <mr.fuxi@gmail.com>
2015-08-12 22:34:25 +01:00
Mazz Mosley da36ee7cbc Perform schema validation
Define a schema that we can pass to jsonschema to validate against the
config a user has supplied. This will help catch a wide variety of common
errors that occur.

If the config does not pass schema validation then it raises an exception
and prints out human readable reasons.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-08-07 12:06:34 +01:00
Mazz Mosley c6e03d739d Test self referencing 'file'
When specifying the 'file' key to a value of it's own name, test
that this works and does not cause a false positive circular reference
error.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 14:14:47 +01:00
Mazz Mosley 6e4a954dbd 'file' key can be omitted from extends
If the 'file' key is not set in the extends_options dict then we
look for the 'service' from within the same file.

Fixes this issue: https://github.com/docker/compose/issues/1237

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
2015-07-03 11:26:30 +01:00
Aanand Prasad b0cb31c186 Use 'top' instead of 'sleep' as a dummy command
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-05-21 16:24:29 +01:00
Timothy Van Heest 855855a0e6 Fix for #1350, nonexisting build path in parent section causes extending section to fail
Signed-off-by: Timothy Van Heest <timothy.vanheest@gmail.com>
2015-04-27 10:55:30 -04:00
Aanand Prasad 4c582e4352 Implement `extends`
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-03-20 15:45:16 -07:00