mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(api): sort upstreams in the API response
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -82,6 +83,9 @@ func GetAlertmanagers() []*Alertmanager {
|
||||
for _, am := range upstreams {
|
||||
ams = append(ams, am)
|
||||
}
|
||||
sort.Slice(ams[:], func(i, j int) bool {
|
||||
return ams[i].Name < ams[j].Name
|
||||
})
|
||||
return ams
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user