From 2d0c2d350bb1819944a9f2413e5c8a3cf3158334 Mon Sep 17 00:00:00 2001 From: "alvaro.gonzalez" Date: Wed, 28 Aug 2024 16:09:41 +0300 Subject: [PATCH] In case limits do not exists --- src/tesk_core/taskmaster.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tesk_core/taskmaster.py b/src/tesk_core/taskmaster.py index 1a38a61..b36c161 100755 --- a/src/tesk_core/taskmaster.py +++ b/src/tesk_core/taskmaster.py @@ -30,8 +30,9 @@ def run_executor(executor, namespace, pvc=None): spec['restartPolicy'] = spec['restart_policy'] for container in spec['containers']: - if container['resources']['limits'] is None and \ - container['resources']['requests'] is not None: + if ('limits' not in container['resources'].keys() or \ + container['resources']['limits'] is None) and \ + container['resources']['requests'] is not None: container['resources']['limits'] = container['resources']['requests'] if pvc is not None: