Skip to content

Commit

Permalink
delete tenant from skipped list if it's not owned by the instance, al…
Browse files Browse the repository at this point in the history
…ways use the default config in startAlertmanager()
  • Loading branch information
santihernandezc committed Mar 5, 2025
1 parent c688474 commit 845c08c
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pkg/alertmanager/multitenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -1124,19 +1124,12 @@ func (am *MultitenantAlertmanager) serveRequest(w http.ResponseWriter, req *http
func (am *MultitenantAlertmanager) startAlertmanager(ctx context.Context, userID string) (*Alertmanager, error) {
// Avoid starting the Alertmanager for tenants not owned by this instance.
if !am.isUserOwned(userID) {
am.lastRequestTime.Delete(userID)
return nil, errors.Wrap(errNotUploadingFallback, "user not owned by this instance")
}

cfg, err := am.store.GetAlertConfig(ctx, userID)
if err != nil {
if !errors.Is(err, alertspb.ErrNotFound) {
return nil, errors.Wrap(err, "failed to check for existing configuration")
}
cfg = alertspb.ToProto("", nil, userID)
}

amConfig := amConfig{
AlertConfigDesc: cfg,
AlertConfigDesc: alertspb.ToProto("", nil, userID),
tmplExternalURL: am.cfg.ExternalURL.URL,
}
if err := am.setConfig(amConfig); err != nil {
Expand Down

0 comments on commit 845c08c

Please sign in to comment.