diff options
author | Sebastien Premont-Tendland <sebastien.premont@bell.ca> | 2020-05-26 18:32:33 -0400 |
---|---|---|
committer | Sebastien Premont-Tendland <sebastien.premont@bell.ca> | 2020-05-26 18:38:58 -0400 |
commit | c1e95eec5660abd9540400784e9777257d7abcac (patch) | |
tree | da1c36a01cb3a54f4debfb817c1b69564c0721f0 /kubernetes/readiness/src | |
parent | dbab15fde615d85748f4664bf16376f5643453ac (diff) |
Fix readiness-check ready.py script for stateful set
Only check the status field readyReplicas instead of
currentReplicas and updatedReplicas. The value of currentReplicas
relates to the number of pods created with the first revision of
the stateful set. If a change is made to the stateful set and pods are restarted
then currentReplicas is no longer returned in the status.
Check JIRA for more information.
Issue-ID: OOM-2418
Signed-off-by: Sebastien Premont-Tendland <sebastien.premont@bell.ca>
Change-Id: If5dbc892b6d807e6ca681457f9874613fce7db04
Diffstat (limited to 'kubernetes/readiness/src')
-rw-r--r-- | kubernetes/readiness/src/main/scripts/ready.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kubernetes/readiness/src/main/scripts/ready.py b/kubernetes/readiness/src/main/scripts/ready.py index 93932073cd..b932b04284 100644 --- a/kubernetes/readiness/src/main/scripts/ready.py +++ b/kubernetes/readiness/src/main/scripts/ready.py @@ -60,10 +60,8 @@ def wait_for_statefulset_complete(statefulset_name): try: response = api.read_namespaced_stateful_set(statefulset_name, namespace) s = response.status - if (s.updated_replicas == response.spec.replicas and - s.replicas == response.spec.replicas and + if (s.replicas == response.spec.replicas and s.ready_replicas == response.spec.replicas and - s.current_replicas == response.spec.replicas and s.observed_generation == response.metadata.generation): log.info("Statefulset " + statefulset_name + " is ready") return True |