summaryrefslogtreecommitdiffstats
path: root/kubernetes/readiness/docker/init
diff options
context:
space:
mode:
authorDavid, Dana (dd775k) <dd775k@att.com>2018-07-29 14:28:52 +0300
committerDavid, Dana (dd775k) <dd775k@intl.att.com>2018-07-31 10:51:01 +0300
commit2988e545894a785552da6487e877b682584b3b9f (patch)
treeff7d6ad897bf90532122f97c36a784a6771549cd /kubernetes/readiness/docker/init
parentc07edcbcacb435b7d6fced04af3f67e2e9eeadc0 (diff)
Add readiness support for StatefulSet resource
Change-Id: Ia2d68adfc871041e7ff5a5b27685b0b5f3acadcd Issue-ID: VID-236 Signed-off-by: David, Dana (dd775k) <dd775k@intl.att.com>
Diffstat (limited to 'kubernetes/readiness/docker/init')
-rw-r--r--kubernetes/readiness/docker/init/ready.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/kubernetes/readiness/docker/init/ready.py b/kubernetes/readiness/docker/init/ready.py
index 6d2edef81c..f4a5e5da8f 100644
--- a/kubernetes/readiness/docker/init/ready.py
+++ b/kubernetes/readiness/docker/init/ready.py
@@ -41,7 +41,16 @@ def is_ready(container_name):
if i.status.container_statuses is None:
continue
for s in i.status.container_statuses:
- if s.name == container_name:
+ if i.metadata.owner_references[0].kind == "StatefulSet":
+ if i.metadata.name == container_name:
+ ready = s.ready
+ if not ready:
+ log.info(container_name + " is not ready.")
+ else:
+ log.info(container_name + " is ready!")
+ else:
+ continue
+ elif s.name == container_name:
ready = s.ready
if not ready:
log.info(container_name + " is not ready.")