fix(cicd): wire hwlab branch-follower health gate
This commit is contained in:
@@ -186,12 +186,26 @@ async function runtimeSummary(expected) {
|
||||
|
||||
async function healthSummary() {
|
||||
if (!healthUrl) return { ok: null, reason: "health-url-not-configured" };
|
||||
const targets = [`${healthUrl.replace(/\/+$/u, "")}/health/readiness`, `${healthUrl.replace(/\/+$/u, "")}/health/live`];
|
||||
const targets = healthProbeTargets(healthUrl);
|
||||
const probes = [];
|
||||
for (const url of targets) probes.push(await httpProbe(url));
|
||||
return { ok: probes.every((probe) => probe.ok), probes };
|
||||
}
|
||||
|
||||
function healthProbeTargets(value) {
|
||||
const trimmed = value.replace(/\/+$/u, "");
|
||||
try {
|
||||
const parsed = new URL(trimmed);
|
||||
const pathname = parsed.pathname.replace(/\/+$/u, "");
|
||||
if (pathname.endsWith("/health") || pathname.endsWith("/api/health") || pathname.endsWith("/health/readiness") || pathname.endsWith("/health/live")) {
|
||||
return [trimmed];
|
||||
}
|
||||
} catch {
|
||||
// Fall back to the historical base-url contract when HEALTH_URL is not a full URL.
|
||||
}
|
||||
return [`${trimmed}/health/readiness`, `${trimmed}/health/live`];
|
||||
}
|
||||
|
||||
function workloadSummary(spec, item, expected) {
|
||||
const status = item?.status || {};
|
||||
const desired = item?.spec?.replicas ?? 1;
|
||||
|
||||
Reference in New Issue
Block a user