Merge pull request #2573 from roidelapluie/rel-022-2549

Fix panic when HA is disabled
This commit is contained in:
Julien Pivotto 2021-05-07 13:40:05 +02:00 committed by GitHub
commit caa2918039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -426,6 +426,15 @@ func run() int {
inhibitor = inhibit.NewInhibitor(alerts, conf.InhibitRules, marker, logger)
silencer := silence.NewSilencer(silences, marker, logger)
// An interface value that holds a nil concrete value is non-nil.
// Therefore we explicly pass an empty interface, to detect if the
// cluster is not enabled in notify.
var pipelinePeer notify.Peer
if peer != nil {
pipelinePeer = peer
}
pipeline := pipelineBuilder.New(
receivers,
waitFunc,
@ -433,7 +442,7 @@ func run() int {
silencer,
muteTimes,
notificationLog,
peer,
pipelinePeer,
)
configuredReceivers.Set(float64(len(activeReceivers)))
configuredIntegrations.Set(float64(integrationsNum))