feat: add configuration checking

This commit is contained in:
Jonas Kaninda
2024-11-10 14:52:31 +01:00
parent 1a038ce0f5
commit a549e33e9a
9 changed files with 202 additions and 36 deletions

View File

@@ -72,8 +72,8 @@ func (heathRoute HealthCheckRoute) HealthCheckHandler(w http.ResponseWriter, r *
for _, route := range heathRoute.Routes {
go func() {
defer wg.Done()
if route.HealthCheck != "" {
err := healthCheck(route.Destination + route.HealthCheck)
if route.HealthCheck.Path != "" {
err := healthCheck(route.Destination+route.HealthCheck.Path, route.HealthCheck.HealthyStatuses)
if err != nil {
if heathRoute.DisableRouteHealthCheckError {
routes = append(routes, HealthCheckRouteResponse{Name: route.Name, Status: "unhealthy", Error: "Route healthcheck errors disabled"})