mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
notifier: Fixes path for uploaded image for Slack notifier
Fixes #10012
This commit is contained in:
parent
e6bf266c4b
commit
554c7ba96f
@ -6,6 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/bus"
|
"github.com/grafana/grafana/pkg/bus"
|
||||||
@ -176,7 +177,7 @@ func (this *SlackNotifier) Notify(evalContext *alerting.EvalContext) error {
|
|||||||
|
|
||||||
func SlackFileUpload(evalContext *alerting.EvalContext, log log.Logger, url string, recipient string, token string) error {
|
func SlackFileUpload(evalContext *alerting.EvalContext, log log.Logger, url string, recipient string, token string) error {
|
||||||
if evalContext.ImageOnDiskPath == "" {
|
if evalContext.ImageOnDiskPath == "" {
|
||||||
evalContext.ImageOnDiskPath = "public/img/mixed_styles.png"
|
evalContext.ImageOnDiskPath = filepath.Join(setting.HomePath, "public/img/mixed_styles.png")
|
||||||
}
|
}
|
||||||
log.Info("Uploading to slack via file.upload API")
|
log.Info("Uploading to slack via file.upload API")
|
||||||
headers, uploadBody, err := GenerateSlackBody(evalContext.ImageOnDiskPath, token, recipient)
|
headers, uploadBody, err := GenerateSlackBody(evalContext.ImageOnDiskPath, token, recipient)
|
||||||
|
Loading…
Reference in New Issue
Block a user