From f61dc5c0a15ce6b05ba63400d009b50384c30543 Mon Sep 17 00:00:00 2001 From: Andre Ziviani Date: Thu, 17 Aug 2023 17:45:58 -0300 Subject: [PATCH] fix: Events with empty affected resource list getting ignored --- exporter/health.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/exporter/health.go b/exporter/health.go index 3128aec..8393025 100644 --- a/exporter/health.go +++ b/exporter/health.go @@ -135,6 +135,11 @@ func ignoreEvents(ignoredEvents []string, event string) bool { } func ignoreResources(ignoredResources []string, resources []healthTypes.AffectedEntity) bool { + if len(ignoredResources) == 0 { + // empty ignore list + return false + } + size := len(resources) for _, ignored := range ignoredResources { @@ -155,6 +160,11 @@ func ignoreResources(ignoredResources []string, resources []healthTypes.Affected } func ignoreResourceEvent(ignoredResourceEvent []string, event HealthEvent) bool { + if len(ignoredResourceEvent) == 0 { + // empty ignore list + return false + } + size := len(event.AffectedResources) for _, ignored := range ignoredResourceEvent {