Validate additional files before merging them.
Consolidates all the top level config handling into `process_config_file` which is now used for both files and merge sources. Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
7466d14826
commit
98ad5a05e4
5 changed files with 45 additions and 37 deletions
|
|
@ -96,14 +96,6 @@ def validate_extends_file_path(service_name, extends_options, filename):
|
|||
)
|
||||
|
||||
|
||||
def validate_extended_service_exists(extended_service_name, full_extended_config, extended_config_path):
|
||||
if extended_service_name not in full_extended_config:
|
||||
msg = (
|
||||
"Cannot extend service '%s' in %s: Service not found"
|
||||
) % (extended_service_name, extended_config_path)
|
||||
raise ConfigurationError(msg)
|
||||
|
||||
|
||||
def get_unsupported_config_msg(service_name, error_key):
|
||||
msg = "Unsupported config option for '{}' service: '{}'".format(service_name, error_key)
|
||||
if error_key in DOCKER_CONFIG_HINTS:
|
||||
|
|
@ -264,7 +256,7 @@ def process_errors(errors, service_name=None):
|
|||
msg))
|
||||
else:
|
||||
root_msgs.append(
|
||||
"Service '{}' doesn\'t have any configuration options. "
|
||||
"Service \"{}\" doesn't have any configuration options. "
|
||||
"All top level keys in your docker-compose.yml must map "
|
||||
"to a dictionary of configuration options.'".format(service_name))
|
||||
elif error.validator == 'required':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue