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

This commit is contained in:
Jean-Philippe Quéméner 2022-09-21 16:48:39 +02:00 committed by GitHub
parent 1978b935ba
commit 74c66b29d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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