mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-12 06:19:11 +00:00
7bbc9278a2
SyncStorageAlertsForInstance matched alert.ResourceID against valid storage IDs (plain inventory IDs like 'inst-node-local-zfs'). But ZFS health assessment alerts carry a composite spec resource ID (e.g. 'inst-node-local-zfs/zfs-pool:data') set via params.Spec.ResourceID in evaluateCanonicalStatefulAlert. Every ZFS alert was immediately cleared by the sync sweep right after creation, then re-fired on the next poll — an infinite flapping loop every ~10 seconds. Fix: when the exact resource ID doesn't match, check whether the prefix before the first '/' is a valid storage ID. Storage IDs use hyphens (never slashes), so the prefix cleanly extracts the inventory ID from the composite spec resource ID. Added two test cases: - preserves zfs alerts with composite spec resource ids - clears zfs alerts when storage is removed (ensures fix doesn't prevent legitimate cleanup)