Skip to content

Commit

Permalink
fix: Events with empty affected resource list getting ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreZiviani committed Aug 17, 2023
1 parent c7fc744 commit f61dc5c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions exporter/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit f61dc5c

Please sign in to comment.