Alerting: Update Alerting and Alertmanager to v0.25.1 (#61233)

Update Alerting and Alertmanager to v0.25.1
This commit is contained in:
George Robinson
2023-01-10 16:17:07 +00:00
committed by GitHub
parent 67661c2535
commit d19d8c6625
4 changed files with 241 additions and 169 deletions

View File

@@ -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
}

View File

@@ -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