mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Update Alerting and Alertmanager to v0.25.1 (#61233)
Update Alerting and Alertmanager to v0.25.1
This commit is contained in:
@@ -335,11 +335,11 @@ func (am *Alertmanager) getTemplate() (*template.Template, error) {
|
||||
for name := range am.config.TemplateFiles {
|
||||
paths = append(paths, filepath.Join(am.WorkingDirPath(), name))
|
||||
}
|
||||
return am.templateFromPaths(paths...)
|
||||
return am.templateFromPaths(paths)
|
||||
}
|
||||
|
||||
func (am *Alertmanager) templateFromPaths(paths ...string) (*template.Template, error) {
|
||||
tmpl, err := template.FromGlobs(paths...)
|
||||
func (am *Alertmanager) templateFromPaths(paths []string) (*template.Template, error) {
|
||||
tmpl, err := template.FromGlobs(paths)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -395,7 +395,7 @@ func (am *Alertmanager) applyConfig(cfg *apimodels.PostableUserConfig, rawConfig
|
||||
}
|
||||
|
||||
// With the templates persisted, create the template list using the paths.
|
||||
tmpl, err := am.templateFromPaths(paths...)
|
||||
tmpl, err := am.templateFromPaths(paths)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ func templateForTests(t *testing.T) *template.Template {
|
||||
_, err = f.WriteString(channels.TemplateForTestsString)
|
||||
require.NoError(t, err)
|
||||
|
||||
tmpl, err := template.FromGlobs(f.Name())
|
||||
tmpl, err := template.FromGlobs([]string{f.Name()})
|
||||
require.NoError(t, err)
|
||||
|
||||
return tmpl
|
||||
|
||||
Reference in New Issue
Block a user