Do not print Swarm mode warning when connecting to a UCP server

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2016-10-24 11:36:44 -07:00
parent 3147090fb4
commit ea68be3441
1 changed files with 4 additions and 0 deletions

View File

@ -538,6 +538,10 @@ def get_volumes_from(project, service_dict):
def warn_for_swarm_mode(client): def warn_for_swarm_mode(client):
info = client.info() info = client.info()
if info.get('Swarm', {}).get('LocalNodeState') == 'active': if info.get('Swarm', {}).get('LocalNodeState') == 'active':
if info.get('ServerVersion', '').startswith('ucp'):
# UCP does multi-node scheduling with traditional Compose files.
return
log.warn( log.warn(
"The Docker Engine you're using is running in swarm mode.\n\n" "The Docker Engine you're using is running in swarm mode.\n\n"
"Compose does not use swarm mode to deploy services to multiple nodes in a swarm. " "Compose does not use swarm mode to deploy services to multiple nodes in a swarm. "