fix(alerting): Alphabetically sort Matrix provider

This commit is contained in:
Kalissaac
2022-07-19 10:05:27 -07:00
committed by TwiN
parent 9d4a639f31
commit 755c8bb43a
4 changed files with 40 additions and 40 deletions

View File

@ -87,6 +87,12 @@ func (config Config) GetAlertingProviderByAlertType(alertType alert.Type) provid
return nil
}
return config.GoogleChat
case alert.TypeMatrix:
if config.Matrix == nil {
// Since we're returning an interface, we need to explicitly return nil, even if the provider itself is nil
return nil
}
return config.Matrix
case alert.TypeMattermost:
if config.Mattermost == nil {
// Since we're returning an interface, we need to explicitly return nil, even if the provider itself is nil
@ -135,12 +141,6 @@ func (config Config) GetAlertingProviderByAlertType(alertType alert.Type) provid
return nil
}
return config.Twilio
case alert.TypeMatrix:
if config.Matrix == nil {
// Since we're returning an interface, we need to explicitly return nil, even if the provider itself is nil
return nil
}
return config.Matrix
}
return nil
}