fix: Pass local_host to _get_glances_address in containers route (#172)

The get_containers_rows_by_host endpoint was missing the local_host
parameter when calling _get_glances_address, causing it to use the
external IP instead of the container name for the local host.

This caused "Connection timed out" errors on the live-stats page
when the web UI container couldn't reach its own host via the
external IP (hairpin NAT issue).
This commit is contained in:
Bas Nijholt
2026-01-18 21:23:21 +01:00
committed by GitHub
parent ed450c65e5
commit e1a8ceb9e6

View File

@@ -253,7 +253,8 @@ async def get_containers_rows_by_host(host_name: str) -> HTMLResponse:
return HTMLResponse("")
host = config.hosts[host_name]
glances_address = _get_glances_address(host_name, host, config.glances_stack)
local_host = config.get_local_host_from_web_stack()
glances_address = _get_glances_address(host_name, host, config.glances_stack, local_host)
t0 = time.monotonic()
containers, error = await fetch_container_stats(host_name, glances_address)