mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
Merge pull request #7946 from aiordache/config_warning
Bring back warning for configs in non-swarm mode
This commit is contained in:
commit
c45e93971f
@ -374,6 +374,23 @@ def find_candidates_in_parent_dirs(filenames, path):
|
||||
return (candidates, path)
|
||||
|
||||
|
||||
def check_swarm_only_config(service_dicts):
|
||||
warning_template = (
|
||||
"Some services ({services}) use the '{key}' key, which will be ignored. "
|
||||
"Compose does not support '{key}' configuration - use "
|
||||
"`docker stack deploy` to deploy to a swarm."
|
||||
)
|
||||
key = 'configs'
|
||||
services = [s for s in service_dicts if s.get(key)]
|
||||
if services:
|
||||
log.warning(
|
||||
warning_template.format(
|
||||
services=", ".join(sorted(s['name'] for s in services)),
|
||||
key=key
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def load(config_details, interpolate=True):
|
||||
"""Load the configuration from a working directory and a list of
|
||||
configuration files. Files are loaded in order, and merged on top
|
||||
@ -410,6 +427,8 @@ def load(config_details, interpolate=True):
|
||||
for service_dict in service_dicts:
|
||||
match_named_volumes(service_dict, volumes)
|
||||
|
||||
check_swarm_only_config(service_dicts)
|
||||
|
||||
return Config(main_file.config_version, main_file.version,
|
||||
service_dicts, volumes, networks, secrets, configs)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user