Skip to content

Commit

Permalink
Use absolute path of template to decide if we need to remove it
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxvms committed Dec 7, 2022
1 parent 3697e4e commit 076b234
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [ENHANCEMENT] Ruler: Added `-ruler.alertmanager-client.tls-enabled` configuration for alertmanager client. #3432 #3597
* [ENHANCEMENT] Activity tracker logs now have `component=activity-tracker` label. #3556
* [BUGFIX] Log the names of services that are not yet running rather than `unsupported value type` when calling `/ready` and some services are not running. #3625
* [BUGFIX] Alertmanager: Fix template spurious deletion with relative data dir. #3604

### Mixin
* [BUGFIX] Alerts: Fixed `MimirCompactorSkippedBlocksWithOutOfOrderChunks` matching on non-existent label. #3628
Expand Down
6 changes: 5 additions & 1 deletion pkg/alertmanager/multitenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,11 @@ func (am *MultitenantAlertmanager) setConfig(cfg alertspb.AlertConfigDesc) error
// List existing files to keep track of the ones to be removed
if oldTemplateFiles, err := os.ReadDir(userTemplateDir); err == nil {
for _, file := range oldTemplateFiles {
pathsToRemove[filepath.Join(userTemplateDir, file.Name())] = struct{}{}
templateFilePath, err := safeTemplateFilepath(userTemplateDir, file.Name())
if err != nil {
return err
}
pathsToRemove[templateFilePath] = struct{}{}
}
}

Expand Down

0 comments on commit 076b234

Please sign in to comment.