fix(notifications): neutralize satellite-local node names in alert bodies (#1640)

* fix(notifications): neutralize satellite-local node names in alert bodies

Fleet-aggregated alerts embedded each instance seed name (often Local)
while the hub badge already named the remote. Drop identity prefixes and
use type-aware local wording so attribution stays on the badge.

* fix(docs): correct image-update default check cadence

Operator docs still said six-hour polling; the seeded default is two
hours in interval mode, and the cadence is configurable or cron-based.

* test(notifications): assert hub stamps roster name on neutral remote bodies

Cover the fan-in path that attaches hub roster identity while leaving the
satellite message body unchanged.
This commit is contained in:
Anso
2026-07-16 15:51:52 -04:00
committed by GitHub
parent b91025dc8b
commit d8e4ede94f
12 changed files with 288 additions and 48 deletions
+15 -3
View File
@@ -298,7 +298,15 @@ export class SchedulerService {
if (task.node_id != null && task.action !== 'snapshot') {
const node = db.getNode(task.node_id);
if (!node) throw new Error(`Target node (id=${task.node_id}) no longer exists`);
if (node.status === 'offline') throw new Error(`Target node "${node.name}" is offline`);
if (node.status === 'offline') {
// Local seed name ("Local") must not reach fleet-aggregated alerts;
// remote roster names stay for diagnosis.
throw new Error(
node.type === 'local'
? 'Target node is offline'
: `Target node "${node.name}" is offline`,
);
}
}
if (isDebugEnabled()) console.log(`[SchedulerService:debug] Task ${task.id} pre-checks passed, executing ${task.action}`);
@@ -813,8 +821,12 @@ export class SchedulerService {
* segment.
*/
private containerNotFoundMessage(containerName: string, nodeId: number): string {
const nodeName = NodeRegistry.getInstance().getNode(nodeId)?.name ?? String(nodeId);
return `Container "${containerName}" not found on node "${nodeName}". It may have been renamed or removed.`;
const node = NodeRegistry.getInstance().getNode(nodeId);
// Only an explicit local node is neutralized; missing lookup keeps the id fallback.
const location = node?.type === 'local'
? 'on this node'
: `on node "${node?.name ?? String(nodeId)}"`;
return `Container "${containerName}" not found ${location}. It may have been renamed or removed.`;
}
/** Hub target tag used for startsWith rethrow guards (no trailing detail). */