From 931f059f87f7673599423d2cb679b445982f66f8 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Wed, 17 Jul 2024 16:20:22 +0200 Subject: [PATCH] icinga2: Don't reuse fake acknowledgement-set event --- internal/icinga2/client_api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/icinga2/client_api.go b/internal/icinga2/client_api.go index 315d5a09..5dc7d533 100644 --- a/internal/icinga2/client_api.go +++ b/internal/icinga2/client_api.go @@ -301,6 +301,7 @@ func (client *Client) checkMissedChanges(ctx context.Context, objType string, ca } fakeEv.Message = attrs.LastCheckResult.Output + ackEvent := *fakeEv select { case catchupEventCh <- &catchupEventMsg{eventMsg: &eventMsg{fakeEv, attrs.LastStateChange.Time()}}: if fakeEv.Type == event.TypeUnmute { @@ -325,7 +326,7 @@ func (client *Client) checkMissedChanges(ctx context.Context, objType string, ca select { // Retry the AckSet event so that the author of the ack is set as the incident // manager if there was no existing incident before the above state change event. - case catchupEventCh <- &catchupEventMsg{eventMsg: &eventMsg{fakeEv, attrs.LastStateChange.Time()}}: + case catchupEventCh <- &catchupEventMsg{eventMsg: &eventMsg{&ackEvent, attrs.LastStateChange.Time()}}: case <-ctx.Done(): return ctx.Err() }