Add more output on ingress waiter
Some checks failed
Lint Checks / Run linter (pull_request) Successful in 38s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m33s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m22s
Smoke Test / Run basic test suite (pull_request) Successful in 4m42s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Failing after 15m11s

This commit is contained in:
David Boreham 2024-02-16 17:18:59 -07:00
parent 139e1f25b6
commit c694074225

View File

@ -46,15 +46,21 @@ def destroy_cluster(name: str):
def wait_for_ingress_in_kind(): def wait_for_ingress_in_kind():
w = watch.Watch()
core_v1 = client.CoreV1Api() core_v1 = client.CoreV1Api()
for event in w.stream(func=core_v1.list_namespaced_pod, for i in range(20):
namespace="ingress-nginx", warned_waiting = False
label_selector="app.kubernetes.io/component=controller", w = watch.Watch()
timeout_seconds=240): for event in w.stream(func=core_v1.list_namespaced_pod,
if event['object'].status.container_statuses: namespace="ingress-nginx",
if event['object'].status.container_statuses[0].ready is True: label_selector="app.kubernetes.io/component=controller",
return timeout_seconds=30):
if event['object'].status.container_statuses:
if event['object'].status.container_statuses[0].ready is True:
if warned_waiting:
print("Ingress controller is ready")
return
print("Waiting for ingress controller to become ready...")
warned_waiting = True
error_exit("ERROR: Timed out waiting for ingress to become ready") error_exit("ERROR: Timed out waiting for ingress to become ready")