Skip to content

Commit aae1cdf

Browse files
committed
fix(kuma-config): only treat Kuma's not-found as a missing status page
Rethrow other getStatusPage errors instead of proceeding to create, and honor the round-trip contract for showTags/showCertificateExpiry when the YAML omits them.
1 parent 465e2ba commit aae1cdf

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

kuma-config/apply.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,12 @@ async function main() {
331331
// here are never touched. Events verified against 2.3.2 and 2.5.0:
332332
// getStatusPage / addStatusPage / saveStatusPage have identical signatures.
333333
for (const sp of cfg.statusPages || []) {
334-
const existing = await emit("getStatusPage", sp.slug).catch(() => null);
334+
// Kuma answers a missing slug with the literal "No slug?"; anything
335+
// else (auth, transport) is a real failure and must abort the apply.
336+
const existing = await emit("getStatusPage", sp.slug).catch((e) => {
337+
if (e.message === "No slug?") return null;
338+
throw e;
339+
});
335340
if (DRY_RUN) {
336341
log(
337342
`[dry-run] ${existing ? "reconcile" : "create"} status page "${sp.slug}" (${(sp.groups || []).length} groups)`,
@@ -368,9 +373,12 @@ async function main() {
368373
title: sp.title,
369374
description: sp.description ?? full.description ?? null,
370375
theme: sp.theme || full.theme || "auto",
371-
showTags: !!sp.showTags,
376+
showTags: sp.showTags ?? full.showTags ?? false,
372377
showPoweredBy: sp.showPoweredBy ?? full.showPoweredBy ?? false,
373-
showCertificateExpiry: !!sp.showCertificateExpiry,
378+
showCertificateExpiry:
379+
sp.showCertificateExpiry ??
380+
full.showCertificateExpiry ??
381+
false,
374382
},
375383
full.icon || "",
376384
groupList,

0 commit comments

Comments
 (0)