From 9d17d40b86810b69ae6dd058db6f1e6bd24796df Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 29 Mar 2021 13:09:31 -0400 Subject: [PATCH] Add setting for keeping container group pod after job run Helpful for debugging --- awx/main/tasks.py | 2 +- awx/settings/defaults.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 6cadc1973e..43a629b288 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -3010,7 +3010,7 @@ class AWXReceptorJob: return self._run_internal(receptor_ctl) finally: # Make sure to always release the work unit if we established it - if self.unit_id is not None: + if self.unit_id is not None and not settings.AWX_CONTAINER_GROUP_KEEP_POD: receptor_ctl.simple_command(f"work release {self.unit_id}") def _run_internal(self, receptor_ctl): diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 11208e82e0..28f5b20ec8 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -68,6 +68,7 @@ DATABASES = { # the K8S cluster where awx itself is running) IS_K8S = False +AWX_CONTAINER_GROUP_KEEP_POD = True AWX_CONTAINER_GROUP_K8S_API_TIMEOUT = 10 AWX_CONTAINER_GROUP_POD_LAUNCH_RETRIES = 100 AWX_CONTAINER_GROUP_POD_LAUNCH_RETRY_DELAY = 5