mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Only include image in notifier when enabled (#23194)
Fixes a bug when you had multiple notifiers for a rule, but not all had enabled to include image. Fixes #22883
This commit is contained in:
committed by
GitHub
parent
ea08c148df
commit
6bd7411f04
@@ -152,15 +152,17 @@ func (gcn *GoogleChatNotifier) Notify(evalContext *alerting.EvalContext) error {
|
||||
}
|
||||
widgets = append(widgets, fields)
|
||||
|
||||
// if an image exists, add it as an image widget
|
||||
if evalContext.ImagePublicURL != "" {
|
||||
widgets = append(widgets, imageWidget{
|
||||
Image: image{
|
||||
ImageURL: evalContext.ImagePublicURL,
|
||||
},
|
||||
})
|
||||
} else {
|
||||
gcn.log.Info("Could not retrieve a public image URL.")
|
||||
if gcn.NeedsImage() {
|
||||
// if an image exists, add it as an image widget
|
||||
if evalContext.ImagePublicURL != "" {
|
||||
widgets = append(widgets, imageWidget{
|
||||
Image: image{
|
||||
ImageURL: evalContext.ImagePublicURL,
|
||||
},
|
||||
})
|
||||
} else {
|
||||
gcn.log.Info("Could not retrieve a public image URL.")
|
||||
}
|
||||
}
|
||||
|
||||
// add a button widget (link to Grafana)
|
||||
|
||||
Reference in New Issue
Block a user