Merge "Fix failed pods not being detected by rootca health check"

This commit is contained in:
Zuul 2024-03-14 19:48:59 +00:00 committed by Gerrit Code Review
commit ae8bb0f4d5
1 changed files with 7 additions and 0 deletions

View File

@ -264,6 +264,13 @@ class Health(object):
if pod.status.phase not in ['Pending', 'Running', 'Succeeded']:
# Add it to the failed list as it's not ready/completed/pending
fail_pod_list.append((pod.metadata.name, pod.metadata.namespace))
elif pod.status.phase == 'Running':
for container_status in pod.status.container_statuses:
if container_status.ready is not True:
# Pod has running status but it's not ready
fail_pod_list.append((pod.metadata.name,
pod.metadata.namespace))
break
success = not fail_pod_list
return success, fail_pod_list