[VOL-2102] The OpenONU adapter should update its K8s Ready state to false when it loses connectivity to its required services
Change-Id: Ibc849d07de2c0e524f2cc9df1b81ca4660e44c8f
diff --git a/python/adapters/brcm_openomci_onu/probe.py b/python/adapters/brcm_openomci_onu/probe.py
index 32646fd..ca58652 100644
--- a/python/adapters/brcm_openomci_onu/probe.py
+++ b/python/adapters/brcm_openomci_onu/probe.py
@@ -19,15 +19,19 @@
log = get_logger()
class Probe(SimpleHTTPRequestHandler):
- kafka_adapter_proxy_running = False
+ # Checks for Onu Adapter Readiness; all should be true
kafka_cluster_proxy_running = False
- register_adapter_with_core = False
+ kafka_adapter_proxy_running = False
+ adapter_registered_with_core = False
+
+ # Only Kafka connectivity check defines Liveness
+ kafka_proxy_faulty = True
def readiness_probe(self):
- return Probe.kafka_adapter_proxy_running and Probe.kafka_cluster_proxy_running and Probe.register_adapter_with_core
+ return Probe.kafka_adapter_proxy_running and Probe.kafka_cluster_proxy_running and Probe.adapter_registered_with_core
def liveness_probe(self):
- return Probe.kafka_adapter_proxy_running and Probe.kafka_cluster_proxy_running and Probe.register_adapter_with_core
+ return not Probe.kafka_proxy_faulty
def do_GET(self):
if self.path == '/readz':