mirror of
https://github.com/docker/compose.git
synced 2025-07-31 01:24:15 +02:00
add warning when max_replicas_per_node limits scale
Signed-off-by: Anca Iordache <anca.iordache@docker.com> (cherry picked from commit 79fe7ca997f01d16817e769a7a73b3b1b3135fdc)
This commit is contained in:
parent
5d34f12f07
commit
15bb3eeb39
@ -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'] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user