mirror of
https://github.com/docker/compose.git
synced 2025-07-23 21:54:40 +02:00
Bring back warning for swarm configs
Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
parent
be8523708e
commit
7ca88de76b
@ -373,6 +373,23 @@ def find_candidates_in_parent_dirs(filenames, path):
|
|||||||
return (candidates, 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):
|
def load(config_details, interpolate=True):
|
||||||
"""Load the configuration from a working directory and a list of
|
"""Load the configuration from a working directory and a list of
|
||||||
configuration files. Files are loaded in order, and merged on top
|
configuration files. Files are loaded in order, and merged on top
|
||||||
@ -409,6 +426,8 @@ def load(config_details, interpolate=True):
|
|||||||
for service_dict in service_dicts:
|
for service_dict in service_dicts:
|
||||||
match_named_volumes(service_dict, volumes)
|
match_named_volumes(service_dict, volumes)
|
||||||
|
|
||||||
|
check_swarm_only_config(service_dicts)
|
||||||
|
|
||||||
return Config(main_file.config_version, main_file.version,
|
return Config(main_file.config_version, main_file.version,
|
||||||
service_dicts, volumes, networks, secrets, configs)
|
service_dicts, volumes, networks, secrets, configs)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user