mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
Always sort InhibitedBy & SilencedBy to ensure order don't change between update
This commit is contained in:
@@ -6,6 +6,7 @@ package v04
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sort"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -111,6 +112,8 @@ func (m AlertMapper) GetAlerts(uri string, timeout time.Duration) ([]models.Aler
|
||||
InhibitedBy: inhibitedBy,
|
||||
SilencedBy: silencedBy,
|
||||
}
|
||||
sort.Strings(a.InhibitedBy)
|
||||
sort.Strings(a.SilencedBy)
|
||||
alertList = append(alertList, a)
|
||||
}
|
||||
ug := models.AlertGroup{
|
||||
|
||||
@@ -6,6 +6,7 @@ package v05
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/blang/semver"
|
||||
@@ -110,6 +111,8 @@ func (m AlertMapper) GetAlerts(uri string, timeout time.Duration) ([]models.Aler
|
||||
InhibitedBy: inhibitedBy,
|
||||
SilencedBy: silencedBy,
|
||||
}
|
||||
sort.Strings(a.InhibitedBy)
|
||||
sort.Strings(a.SilencedBy)
|
||||
alertList = append(alertList, a)
|
||||
}
|
||||
ug := models.AlertGroup{
|
||||
|
||||
@@ -7,6 +7,7 @@ package v061
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/blang/semver"
|
||||
@@ -109,6 +110,8 @@ func (m AlertMapper) GetAlerts(uri string, timeout time.Duration) ([]models.Aler
|
||||
InhibitedBy: inhibitedBy,
|
||||
SilencedBy: silencedBy,
|
||||
}
|
||||
sort.Strings(a.InhibitedBy)
|
||||
sort.Strings(a.SilencedBy)
|
||||
alertList = append(alertList, a)
|
||||
}
|
||||
ug := models.AlertGroup{
|
||||
|
||||
@@ -7,6 +7,7 @@ package v062
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/blang/semver"
|
||||
@@ -113,6 +114,8 @@ func (m AlertMapper) GetAlerts(uri string, timeout time.Duration) ([]models.Aler
|
||||
InhibitedBy: inhibitedBy,
|
||||
SilencedBy: silencedBy,
|
||||
}
|
||||
sort.Strings(a.InhibitedBy)
|
||||
sort.Strings(a.SilencedBy)
|
||||
alertList = append(alertList, a)
|
||||
}
|
||||
ug := models.AlertGroup{
|
||||
|
||||
Reference in New Issue
Block a user