Config now catches undefined service links Fixes issue #2922 Signed-off-by: John Harris <john@johnharris.io>
This commit is contained in:
parent
2a8c2c8ad6
commit
e4d2d7ed8a
2 changed files with 10 additions and 0 deletions
|
|
@ -171,6 +171,14 @@ def validate_network_mode(service_config, service_names):
|
|||
"is undefined.".format(s=service_config, dep=dependency))
|
||||
|
||||
|
||||
def validate_links(service_config, service_names):
|
||||
for dependency in service_config.config.get('links', []):
|
||||
if dependency not in service_names:
|
||||
raise ConfigurationError(
|
||||
"Service '{s.name}' has a link to service '{dep}' which is "
|
||||
"undefined.".format(s=service_config, dep=dependency))
|
||||
|
||||
|
||||
def validate_depends_on(service_config, service_names):
|
||||
for dependency in service_config.config.get('depends_on', []):
|
||||
if dependency not in service_names:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue