Просмотр исходного кода

add warning when max_replicas_per_node limits scale

Signed-off-by: Anca Iordache <[email protected]>
Anca Iordache 5 лет назад
Родитель
Сommit
79fe7ca997
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      compose/config/config.py

+ 3 - 0
compose/config/config.py

@@ -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'] = {