Compare commits

..

1 Commits

Author SHA1 Message Date
32d0c2aa1e feat: node readiness now supports a check query param with node_ready and okd_router_1936 options
Some checks failed
Run Check Script / check (pull_request) Failing after 1m39s
2026-03-02 14:53:22 -05:00

View File

@@ -186,31 +186,31 @@ async fn health(query: web::Query<HealthQuery>) -> impl Responder {
let all_passed = check_results.iter().all(|c| c.passed); let all_passed = check_results.iter().all(|c| c.passed);
if all_passed { if all_passed {
info!( info!(
"All health checks passed for node '{}' in {}ms", "All health checks passed for node '{}' in {}ms",
node_name, total_duration_ms node_name, total_duration_ms
); );
HttpResponse::Ok().json(HealthStatus { HttpResponse::Ok().json(HealthStatus {
status: "ready".to_string(), status: "ready".to_string(),
checks: check_results, checks: check_results,
total_duration_ms, total_duration_ms,
}) })
} else { } else {
let failed_checks: Vec<&str> = check_results let failed_checks: Vec<&str> = check_results
.iter() .iter()
.filter(|c| !c.passed) .filter(|c| !c.passed)
.map(|c| c.name.as_str()) .map(|c| c.name.as_str())
.collect(); .collect();
warn!( warn!(
"Health checks failed for node '{}' in {}ms: {:?}", "Health checks failed for node '{}' in {}ms: {:?}",
node_name, total_duration_ms, failed_checks node_name, total_duration_ms, failed_checks
); );
HttpResponse::ServiceUnavailable().json(HealthStatus { HttpResponse::ServiceUnavailable().json(HealthStatus {
status: "not-ready".to_string(), status: "not-ready".to_string(),
checks: check_results, checks: check_results,
total_duration_ms, total_duration_ms,
}) })
} }
} }
#[actix_web::main] #[actix_web::main]