From cef3dd3a28537f0fbdc252c1720aa1f504722f6c Mon Sep 17 00:00:00 2001 From: Cristian Felipe Cruz Buitron Date: Wed, 26 Aug 2026 13:29:34 -0500 Subject: [PATCH] lab-agent: follow redirects on public domain health checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commerce.cruzcloud.net's root path now 301s to /app (Medusa admin) via a Traefik Middleware — without -L the check reported a false 404 on an otherwise healthy service. Generic fix (curl -L) instead of hardcoding a per-domain path, since routing now owns the redirect. --- lab-agent/lab-agent.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lab-agent/lab-agent.sh b/lab-agent/lab-agent.sh index 00c29b4..737e593 100755 --- a/lab-agent/lab-agent.sh +++ b/lab-agent/lab-agent.sh @@ -449,7 +449,11 @@ CLUSTER_WIDE_SNAPSHOT="$("$KUBECTL_BIN" get pods -A -o custom-columns='NS:.metad PUBLIC_CHECKS="" for d in $PUBLIC_DOMAINS; do - code="$(curl -s -o /dev/null -w '%{http_code}' --max-time 10 "https://${d}/" 2>/dev/null || echo "000")" + # -L: sigue redirects (ej. commerce.cruzcloud.net/ -> /app vía Middleware + # de Traefik) para reportar el estado final real, sin tener que + # hardcodear una ruta distinta por dominio en este script — el routing + # decide el path, no este check. + code="$(curl -sL -o /dev/null -w '%{http_code}' --max-time 10 "https://${d}/" 2>/dev/null || echo "000")" PUBLIC_CHECKS="${PUBLIC_CHECKS}${d} -> HTTP ${code}\n" log "curl https://${d}/ -> HTTP ${code}" done