diff options
author | othman touijer <othman.touijer@soprasteria.com> | 2021-12-02 15:24:57 +0100 |
---|---|---|
committer | othman touijer <othman.touijer@soprasteria.com> | 2021-12-02 15:24:57 +0100 |
commit | aabacc1226e357a2a6cc35faa6d9f6eca412472b (patch) | |
tree | db3e6935ab0b1212d646031794220b4d0f18111d /ready.py | |
parent | 87a99b1ca0ffd898ee0af845f79f8174e8d5b7d6 (diff) |
[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 <othman.touijer@soprasteria.com>
Change-Id: I5b2617ecdf39a59f7d22f3c0d4cc507801d7bc56
Diffstat (limited to 'ready.py')
-rwxr-xr-x | ready.py | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -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 |