Alerting: Keep order of time and mute time intervals consistent (#83257)

This commit is contained in:
George Robinson
2024-02-22 16:57:20 +00:00
committed by GitHub
parent 1ef2e8d366
commit a564c8c439
5 changed files with 94 additions and 92 deletions
@@ -194,7 +194,10 @@ func TestIntegrationAlertmanagerConfiguration(t *testing.T) {
},
},
}, {
name: "configuration with time intervals",
// TODO: Mute time intervals is deprecated in Alertmanager and scheduled to be
// removed before version 1.0. Remove this test when support for mute time
// intervals is removed.
name: "configuration with mute time intervals",
cfg: apimodels.PostableUserConfig{
AlertmanagerConfig: apimodels.PostableApiAlertingConfig{
Config: apimodels.Config{
@@ -204,7 +207,7 @@ func TestIntegrationAlertmanagerConfiguration(t *testing.T) {
MuteTimeIntervals: []string{"weekends"},
}},
},
TimeIntervals: []config.TimeInterval{{
MuteTimeIntervals: []config.MuteTimeInterval{{
Name: "weekends",
TimeIntervals: []timeinterval.TimeInterval{{
Weekdays: []timeinterval.WeekdayRange{{
@@ -224,10 +227,7 @@ func TestIntegrationAlertmanagerConfiguration(t *testing.T) {
},
},
}, {
// TODO: Mute time intervals is deprecated in Alertmanager and scheduled to be
// removed before version 1.0. Remove this test when support for mute time
// intervals is removed.
name: "configuration with mute time intervals",
name: "configuration with time intervals",
cfg: apimodels.PostableUserConfig{
AlertmanagerConfig: apimodels.PostableApiAlertingConfig{
Config: apimodels.Config{
@@ -237,7 +237,7 @@ func TestIntegrationAlertmanagerConfiguration(t *testing.T) {
MuteTimeIntervals: []string{"weekends"},
}},
},
MuteTimeIntervals: []config.MuteTimeInterval{{
TimeIntervals: []config.TimeInterval{{
Name: "weekends",
TimeIntervals: []timeinterval.TimeInterval{{
Weekdays: []timeinterval.WeekdayRange{{