mirror of https://github.com/status-im/consul.git
Sort by partition/ns/servicename instead of the reverse
This commit is contained in:
parent
0d9c99b227
commit
a559de63dd
|
@ -170,13 +170,13 @@ func getCatalogOverview(catalog *structs.CatalogContents) *structs.CatalogSummar
|
||||||
|
|
||||||
summarySort := func(slice []structs.HealthSummary) func(int, int) bool {
|
summarySort := func(slice []structs.HealthSummary) func(int, int) bool {
|
||||||
return func(i, j int) bool {
|
return func(i, j int) bool {
|
||||||
if slice[i].Name < slice[j].Name {
|
if slice[i].PartitionOrEmpty() < slice[j].PartitionOrEmpty() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if slice[i].NamespaceOrEmpty() < slice[j].NamespaceOrEmpty() {
|
if slice[i].NamespaceOrEmpty() < slice[j].NamespaceOrEmpty() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return slice[i].PartitionOrEmpty() < slice[j].PartitionOrEmpty()
|
return slice[i].Name < slice[j].Name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort.Slice(summary.Nodes, summarySort(summary.Nodes))
|
sort.Slice(summary.Nodes, summarySort(summary.Nodes))
|
||||||
|
|
Loading…
Reference in New Issue