summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMandeep Khinda <Mandeep.Khinda@amdocs.com>2018-08-23 14:18:21 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-23 14:18:21 +0000
commit6d8cb4684e180ac3de045caa7ea21e7ab1369f2e (patch)
tree56de2b737e7d925eadac370dcb4bf6e99036a2c9
parent3111c2c24f91597e6d5536d6bc6e3624c722c557 (diff)
parent2988e545894a785552da6487e877b682584b3b9f (diff)
Merge "Add readiness support for StatefulSet resource"
-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.")