Warn if any services use 'deploy'

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2016-11-10 17:30:46 +00:00
parent d717c88b6e
commit f75ef6862f
1 changed files with 8 additions and 0 deletions
compose/config

View File

@ -330,6 +330,14 @@ def load(config_details):
for service_dict in service_dicts:
match_named_volumes(service_dict, volumes)
services_using_deploy = [s for s in service_dicts if s.get('deploy')]
if services_using_deploy:
log.warn(
"Some services ({}) use the 'deploy' key, which will be ignored. "
"Compose does not support deploy configuration - use the experimental "
"`docker deploy` command to deploy to a swarm."
.format(", ".join(sorted(s['name'] for s in services_using_deploy))))
return Config(main_file.version, service_dicts, volumes, networks)