Skip to content

Conversation

@ekzyis
Copy link
Contributor

@ekzyis ekzyis commented Feb 7, 2026

This PR introduces wait_for_ingress_endpoint, the helper function mentioned in #766 (comment).

It checks every second if ingress is up, in the same way get_ingress_ip_or_host tries to return the ingress IP address or hostname. So when wait_for_ingress_endpoint did not throw, get_ingress_ip_or_host should always succeed.

I considered calling wait_for_ingress_controller inside it, but I think it would be a redundant check.

After this PR has been reviewed, approved, and a new version of warnet has been released, I will create PRs in battle-of-galen-erso and wrath-of-nalo to use wait_for_ingress_endpoint instead of wait_for_ingress_controller in their dashboard upload scripts. This should then fix what #766 intended to fix.

I tested this by deploying regtest_jam from wrath-of-nalo and then running python -c "from warnet.k8s import wait_for_ingress_endpoint; wait_for_ingress_endpoint(timeout=5)". I got the timeout error without minikube tunnel running and no timeout error with it running.

Since the return value of get_ingress_ip_or_host is now no longer used to print the hint for the user, we can now consider making it throw instead of returning None (failing fast instead of potentially obscure error later). However, it's also used in the tests, so they would break without an update. I didn't want to make a decision on this and mess with the tests in this PR to keep the scope low.

Comment on lines 11 to 13
timeout = 300
click.echo(f"Waiting {timeout} seconds for ingress endpoint ...")
wait_for_ingress_endpoint(timeout=timeout)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhh, maybe this hint to the user that we’re waiting for something isn’t needed, since that wasn’t the case before either.

@ekzyis ekzyis force-pushed the wait_for_ingress_endpoint branch from 068fa3d to 3491dff Compare February 7, 2026 17:17
@pinheadmz
Copy link
Contributor

comparing against main branch with NO network deployed, the current error is much cleaner:

main



(.venv) --> warnet dashboard
Error getting ingress IP: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': '05bb78a2-67a1-4bbc-80b5-bc99025f3c1c', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-Flowschema-Uid': '4e49fa6f-4cb9-480d-9629-609a68ae6dcb', 'X-Kubernetes-Pf-Prioritylevel-Uid': '913f6297-a4f8-404d-9008-b24bcb7caf46', 'Date': 'Tue, 10 Feb 2026 19:36:42 GMT', 'Content-Length': '250'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"ingresses.networking.k8s.io \"caddy-ingress\" not found","reason":"NotFound","details":{"name":"caddy-ingress","group":"networking.k8s.io","kind":"ingresses"},"code":404}


Error: Could not get the IP address of the dashboard
If you are running Minikube please run 'minikube tunnel' in a separate terminal
If you are running in the cloud, you may need to wait a short while while the load balancer is provisioned

PR



(.venv) --> warnet dashboard
Waiting 300 seconds for ingress endpoint ...
Traceback (most recent call last):
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/bin/warnet", line 7, in <module>
    sys.exit(cli())
             ~~~^^
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/matthewzipkin/Desktop/work/warnet/src/warnet/dashboard.py", line 13, in dashboard
    wait_for_ingress_endpoint(timeout=timeout)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/matthewzipkin/Desktop/work/warnet/src/warnet/k8s.py", line 342, in wait_for_ingress_endpoint
    ingress = networking_v1.read_namespaced_ingress(CADDY_INGRESS_NAME, LOGGING_NAMESPACE)
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/kubernetes/client/api/networking_v1_api.py", line 3154, in read_namespaced_ingress
    return self.read_namespaced_ingress_with_http_info(name, namespace, **kwargs)  # noqa: E501
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/kubernetes/client/api/networking_v1_api.py", line 3241, in read_namespaced_ingress_with_http_info
    return self.api_client.call_api(
           ~~~~~~~~~~~~~~~~~~~~~~~~^
        '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}', 'GET',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<11 lines>...
        _request_timeout=local_var_params.get('_request_timeout'),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        collection_formats=collection_formats)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/kubernetes/client/api_client.py", line 348, in call_api
    return self.__call_api(resource_path, method,
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
                           path_params, query_params, header_params,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
                           _return_http_data_only, collection_formats,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           _preload_content, _request_timeout, _host)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/kubernetes/client/api_client.py", line 180, in __call_api
    response_data = self.request(
        method, url, query_params=query_params, headers=header_params,
        post_params=post_params, body=body,
        _preload_content=_preload_content,
        _request_timeout=_request_timeout)
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/kubernetes/client/api_client.py", line 373, in request
    return self.rest_client.GET(url,
           ~~~~~~~~~~~~~~~~~~~~^^^^^
                                query_params=query_params,
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^
                                _preload_content=_preload_content,
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                _request_timeout=_request_timeout,
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                headers=headers)
                                ^^^^^^^^^^^^^^^^
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/kubernetes/client/rest.py", line 244, in GET
    return self.request("GET", url,
           ~~~~~~~~~~~~^^^^^^^^^^^^
                        headers=headers,
                        ^^^^^^^^^^^^^^^^
                        _preload_content=_preload_content,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        _request_timeout=_request_timeout,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        query_params=query_params)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/matthewzipkin/Desktop/work/warnet/.venv/lib/python3.14/site-packages/kubernetes/client/rest.py", line 238, in request
    raise ApiException(http_resp=r)
kubernetes.client.exceptions.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': '908901fb-32a8-4710-9add-2dc27e248e12', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-Flowschema-Uid': '4e49fa6f-4cb9-480d-9629-609a68ae6dcb', 'X-Kubernetes-Pf-Prioritylevel-Uid': '913f6297-a4f8-404d-9008-b24bcb7caf46', 'Date': 'Tue, 10 Feb 2026 19:36:01 GMT', 'Content-Length': '250'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"ingresses.networking.k8s.io \"caddy-ingress\" not found","reason":"NotFound","details":{"name":"caddy-ingress","group":"networking.k8s.io","kind":"ingresses"},"code":404}



@ekzyis ekzyis force-pushed the wait_for_ingress_endpoint branch from 2e5b7d3 to ad3e6b7 Compare February 10, 2026 22:34
@ekzyis ekzyis force-pushed the wait_for_ingress_endpoint branch from d5d0256 to 47aeee2 Compare February 10, 2026 22:42
@ekzyis
Copy link
Contributor Author

ekzyis commented Feb 10, 2026

Ohh, right!

I wrapped wait_for_ingress_endpoint in warnet dashboard with a try/except to only print error messages without the stack trace, like before.

When there's no network deployed, it now prints this:

$ warnet dashboard
Waiting 300 seconds for ingress endpoint ...
Failed to read ingress with name "caddy-ingress" from namespace "warnet-logging"
(404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': '554b1105-fca3-4010-9256-1f692cdb50ad', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-Flowschema-Uid': '7838f77f-aae7-489f-a52a-47de37a03e52',
'X-Kubernetes-Pf-Prioritylevel-Uid': '019e4176-5ef0-417b-b058-3833a5b9a2fb', 'Date': 'Tue, 10 Feb 2026 22:40:50 GMT', 'Content-Length': '250'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"ingresses.networking.k8s.io \"caddy-ingress\" not found","reason":"NotFound","details":{"name":"caddy-ingress","group":"networking.k8s.io","kind":"ingresses"},"code":404}

Did you deploy a network?

(The previous hint was misleading; minikube tunnel does not help if no network was deployed.)

Copy link
Contributor

@pinheadmz pinheadmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with docker and minikube, tried to break it, looks good all around. One comment below to be specific because even though a network is running does not garuntee it will ever have an ingress. fix that and we'll merge

Co-authored-by: Matthew Zipkin <pinheadmz@pm.me>
@ekzyis ekzyis force-pushed the wait_for_ingress_endpoint branch from 4b27c3c to afe8321 Compare February 11, 2026 17:30
@pinheadmz pinheadmz merged commit e980311 into bitcoin-dev-project:main Feb 11, 2026
16 checks passed
@ekzyis ekzyis deleted the wait_for_ingress_endpoint branch February 11, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants