Alerting: Fix active time intervals when time interval is renamed (#108534)
This commit is contained in:
+3
@@ -15,6 +15,9 @@
|
||||
],
|
||||
"mute_time_intervals": [
|
||||
"test-interval", "persisted-interval"
|
||||
],
|
||||
"active_time_intervals": [
|
||||
"test-interval", "persisted-interval"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -725,7 +725,9 @@ func TestIntegrationTimeIntervalReferentialIntegrity(t *testing.T) {
|
||||
updatedRoute := legacyCli.GetRoute(t)
|
||||
for idx, route := range updatedRoute.Routes {
|
||||
expectedTimeIntervals := replace(currentRoute.Routes[idx].MuteTimeIntervals, interval.Spec.Name, actual.Spec.Name)
|
||||
assert.Equalf(t, expectedTimeIntervals, route.MuteTimeIntervals, "time interval in routes should have been renamed but it did not")
|
||||
assert.Equalf(t, expectedTimeIntervals, route.MuteTimeIntervals, "mute time interval in routes should have been renamed but it did not")
|
||||
expectedTimeIntervals = replace(currentRoute.Routes[idx].ActiveTimeIntervals, interval.Spec.Name, actual.Spec.Name)
|
||||
assert.Equalf(t, expectedTimeIntervals, route.ActiveTimeIntervals, "active time interval in routes should have been renamed but it did not")
|
||||
}
|
||||
|
||||
interval = *actual
|
||||
|
||||
Reference in New Issue
Block a user