Remote Alertmanager: Remove unneeded SmtpFrom and StaticHeaders fields (#108781)

* Remote Alertmanager: Remove unneeded SmtpFrom and StaticHeaders fields

* remove smtpFrom (am struct)

* move smtp field (am struct)

* fix test
This commit is contained in:
Santiago
2025-07-29 12:14:42 +02:00
committed by GitHub
parent 51a5b0ab65
commit 3c4c3b3f5c
5 changed files with 11 additions and 56 deletions
@@ -37,10 +37,6 @@ type UserGrafanaConfig struct {
Promoted bool `json:"promoted"`
ExternalURL string `json:"external_url"`
SmtpConfig SmtpConfig `json:"smtp_config"`
// TODO: Remove once everything can be sent in the 'SmtpConfig' field.
SmtpFrom string `json:"smtp_from"`
StaticHeaders map[string]string `json:"static_headers"`
}
func (mc *Mimir) ShouldPromoteConfig() bool {
@@ -75,10 +71,6 @@ func (mc *Mimir) CreateGrafanaAlertmanagerConfig(ctx context.Context, cfg Grafan
Promoted: mc.promoteConfig,
ExternalURL: mc.externalURL,
SmtpConfig: mc.smtpConfig,
// TODO: Remove once everything can be sent only in the 'smtp_config' field.
SmtpFrom: mc.smtpFrom,
StaticHeaders: mc.staticHeaders,
})
if err != nil {
return err
@@ -50,10 +50,6 @@ type Mimir struct {
promoteConfig bool
externalURL string
smtpConfig SmtpConfig
// TODO: Remove once everything can be sent in the 'smtp' field.
smtpFrom string
staticHeaders map[string]string
}
type SmtpConfig struct {
@@ -77,10 +73,6 @@ type Config struct {
PromoteConfig bool
ExternalURL string
Smtp SmtpConfig
// TODO: Remove once everything can be sent in the 'smtp_config' field.
SmtpFrom string
StaticHeaders map[string]string
}
// successResponse represents a successful response from the Mimir API.
@@ -125,10 +117,6 @@ func New(cfg *Config, metrics *metrics.RemoteAlertmanager, tracer tracing.Tracer
promoteConfig: cfg.PromoteConfig,
externalURL: cfg.ExternalURL,
smtpConfig: cfg.Smtp,
// TODO: Remove once everything can be sent in the 'smtp_config' field.
smtpFrom: cfg.SmtpFrom,
staticHeaders: cfg.StaticHeaders,
}, nil
}