Skip to content

Commit

Permalink
Chore: Remove outdated code from AM Statefulset generation (prometheu…
Browse files Browse the repository at this point in the history
  • Loading branch information
mviswanathsai authored Nov 28, 2024
1 parent 1f3993e commit bb4514e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/alertmanager/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,12 +616,8 @@ func makeStatefulSetSpec(logger *slog.Logger, a *monitoringv1.Alertmanager, conf
volumes = append(volumes, configVol...)
amVolumeMounts = append(amVolumeMounts, configMount...)

// To avoid breaking users deploying an old version of the config-reloader image.
// TODO: remove the if condition after v0.72.0.
if a.Spec.Web != nil {
configReloaderWebConfigFile = confArg.Value
configReloaderVolumeMounts = append(configReloaderVolumeMounts, configMount...)
}
configReloaderWebConfigFile = confArg.Value
configReloaderVolumeMounts = append(configReloaderVolumeMounts, configMount...)
}

finalSelectorLabels := config.Labels.Merge(podSelectorLabels)
Expand Down
2 changes: 2 additions & 0 deletions pkg/alertmanager/statefulset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ func TestMakeStatefulSetSpecNotificationTemplates(t *testing.T) {

expectedArgsConfigReloader := []string{
"--listen-address=:8080",
"--web-config-file=/etc/alertmanager/web_config/web-config.yaml",
"--reload-url=http://localhost:9093/-/reload",
"--config-file=/etc/alertmanager/config/alertmanager.yaml.gz",
"--config-envsubst-file=/etc/alertmanager/config_out/alertmanager.env.yaml",
Expand Down Expand Up @@ -1024,6 +1025,7 @@ func TestConfigReloader(t *testing.T) {

expectedArgsConfigReloader := []string{
"--listen-address=:8080",
"--web-config-file=/etc/alertmanager/web_config/web-config.yaml",
"--reload-url=http://localhost:9093/-/reload",
"--config-file=/etc/alertmanager/config/alertmanager.yaml.gz",
"--config-envsubst-file=/etc/alertmanager/config_out/alertmanager.env.yaml",
Expand Down

0 comments on commit bb4514e

Please sign in to comment.