From aabacc1226e357a2a6cc35faa6d9f6eca412472b Mon Sep 17 00:00:00 2001 From: othman touijer Date: Thu, 2 Dec 2021 15:24:57 +0100 Subject: [READINESS] Update readiness script Changes on ready.py: * rename wrong variable name * stop if the container job is terminated Issue-ID: OOM-2878 Signed-off-by: othman touijer Change-Id: I5b2617ecdf39a59f7d22f3c0d4cc507801d7bc56 --- ready.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ready.py b/ready.py index 9055950..4eb73ab 100755 --- a/ready.py +++ b/ready.py @@ -228,14 +228,11 @@ def service_mesh_job_check(container_name): name = read_name(item) log.info("Container Details %s ", container) log.info("Container Status %s ", container.state.terminated) - if container.state.terminated is None: - continue - log.info("Container Status Reason %s ", container.state.terminated.reason) - if container.state.terminated.reason == 'Completed': - complete = True - log.info("%s is complete", container_name) - else: - log.info("%s is NOT complete", container_name) + + if container.state.terminated: + log.info("Container Terminated with reason %s ", container.state.terminated.reason) + complete = True + except ApiException as exc: log.error("Exception when calling read_namespaced_job_status: %s\n", exc) @@ -380,7 +377,7 @@ def main(argv): break if time.time() > timeout: log.warning("timed out waiting for '%s' to be ready", - job_name) + service_mesh_job_container_name) sys.exit(1) else: # spread in time potentially parallel execution in multiple -- cgit 1.2.3-korg