Alerting: Skip unsupported file types on provisioning (#55573) (#55584)

(cherry picked from commit 74c66b29d0)

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-09-21 11:04:17 -04:00
committed by GitHub
co-authored by Jean-Philippe Quéméner
parent b7cc6fdf94
commit 97bee8a53a
@@ -35,7 +35,8 @@ func (cr *rulesConfigReader) readConfig(ctx context.Context, path string) ([]*Al
for _, file := range files {
cr.log.Debug("parsing alerting provisioning file", "path", path, "file.Name", file.Name())
if !cr.isYAML(file.Name()) && !cr.isJSON(file.Name()) {
return nil, fmt.Errorf("file has invalid suffix '%s' (.yaml,.yml,.json accepted)", file.Name())
cr.log.Warn(fmt.Sprintf("file has invalid suffix '%s' (.yaml,.yml,.json accepted), skipping", file.Name()))
continue
}
alertFileV1, err := cr.parseConfig(path, file)
if err != nil {