lab-agent: follow redirects on public domain health checks
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.
This commit is contained in:
1 parent
25276ad5b1
commit
cef3dd3a28
1 file changed
+5
-1
@@ -449,7 +449,11 @@ CLUSTER_WIDE_SNAPSHOT="$("$KUBECTL_BIN" get pods -A -o custom-columns='NS:.metad
|
|||||||
|
|
||||||
PUBLIC_CHECKS=""
|
PUBLIC_CHECKS=""
|
||||||
for d in $PUBLIC_DOMAINS; do
|
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"
|
PUBLIC_CHECKS="${PUBLIC_CHECKS}${d} -> HTTP ${code}\n"
|
||||||
log "curl https://${d}/ -> HTTP ${code}"
|
log "curl https://${d}/ -> HTTP ${code}"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in new issue
Block a user