mirror of
https://github.com/prometheus/alertmanager
synced 2025-03-31 23:59:03 +00:00
Fix panic when HA is disabled
Fix #2549 Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
8ec96dbfeb
commit
64e108c3d4
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user