mirror of https://github.com/docker/compose.git
Account for aliased links Fix failing tests Signed-off-by: John Harris <john@johnharris.io>
This commit is contained in:
parent
f7cd94d4a9
commit
f655a8af95
|
@ -172,11 +172,11 @@ def validate_network_mode(service_config, service_names):
|
||||||
|
|
||||||
|
|
||||||
def validate_links(service_config, service_names):
|
def validate_links(service_config, service_names):
|
||||||
for dependency in service_config.config.get('links', []):
|
for link in service_config.config.get('links', []):
|
||||||
if dependency not in service_names:
|
if link.split(':')[0] not in service_names:
|
||||||
raise ConfigurationError(
|
raise ConfigurationError(
|
||||||
"Service '{s.name}' has a link to service '{dep}' which is "
|
"Service '{s.name}' has a link to service '{link}' which is "
|
||||||
"undefined.".format(s=service_config, dep=dependency))
|
"undefined.".format(s=service_config, link=link))
|
||||||
|
|
||||||
|
|
||||||
def validate_depends_on(service_config, service_names):
|
def validate_depends_on(service_config, service_names):
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
mydb:
|
||||||
|
build: '.'
|
||||||
myweb:
|
myweb:
|
||||||
build: '.'
|
build: '.'
|
||||||
extends:
|
extends:
|
||||||
|
|
|
@ -1366,7 +1366,7 @@ class ConfigTest(unittest.TestCase):
|
||||||
build_config_details({
|
build_config_details({
|
||||||
'version': '2',
|
'version': '2',
|
||||||
'services': {
|
'services': {
|
||||||
'web': {'image': 'busybox', 'links': ['db']},
|
'web': {'image': 'busybox', 'links': ['db:db']},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue