fix(cli/server): do not redirect /healthz (#12080)

This commit is contained in:
Cian Johnston
2024-02-09 13:44:47 +00:00
committed by GitHub
parent 92b2e26a48
commit 2b307c7c4e
2 changed files with 14 additions and 1 deletions
+7
View File
@@ -1991,6 +1991,13 @@ func redirectToAccessURL(handler http.Handler, accessURL *url.URL, tunnel bool,
http.Redirect(w, r, accessURL.String(), http.StatusTemporaryRedirect)
}
// Exception: /healthz
// Kubernetes doesn't like it if you redirect your healthcheck or liveness check endpoint.
if r.URL.Path == "/healthz" {
handler.ServeHTTP(w, r)
return
}
// Exception: DERP
// We use this endpoint when creating a DERP-mesh in the enterprise version to directly
// dial other Coderd derpers. Redirecting to the access URL breaks direct dial since the