From 07dc7db266ecfb88a783a94fac5c54e2092bda53 Mon Sep 17 00:00:00 2001 From: BorislavG Date: Wed, 14 Feb 2018 15:23:51 +0200 Subject: Fix readiness-check exception The problem is that the script tried to iterate on statuses of pod containers. when some pod is in state "pending" or some other case when there is no status, the statuses is None. Therefore python throws exception when trying to iterate None, which is non-iterable. Issue-ID: OOM-514 Signed-off-by: BorislavG Change-Id: If57b8a632a83489fddb12373e4047396f5fa08a3 --- kubernetes/readiness/docker/init/ready.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'kubernetes/readiness/docker/init') diff --git a/kubernetes/readiness/docker/init/ready.py b/kubernetes/readiness/docker/init/ready.py index c5b55eef18..7cfb6cdcde 100644 --- a/kubernetes/readiness/docker/init/ready.py +++ b/kubernetes/readiness/docker/init/ready.py @@ -36,6 +36,9 @@ def is_ready(container_name): try: response = v1.list_namespaced_pod(namespace=namespace, watch=False) for i in response.items: + # container_statuses can be None, which is non-iterable. + if i.status.container_statuses is None: + continue for s in i.status.container_statuses: if s.name == container_name: ready = s.ready -- cgit 1.2.3-korg