Skip to content

Commit

Permalink
add warning when max_replicas_per_node limits scale
Browse files Browse the repository at this point in the history
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
  • Loading branch information
aiordache committed Feb 10, 2020
1 parent 02d8e9e commit 79fe7ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compose/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,9 @@ def translate_deploy_keys_to_container_config(service_dict):
scale = deploy_dict.get('replicas', 1)
max_replicas = deploy_dict.get('placement', {}).get('max_replicas_per_node', scale)
service_dict['scale'] = min(scale, max_replicas)
if max_replicas < scale:
log.warning("Scale is limited to {} ('max_replicas_per_node' field).".format(
max_replicas))

if 'restart_policy' in deploy_dict:
service_dict['restart'] = {
Expand Down

0 comments on commit 79fe7ca

Please sign in to comment.