Sort by partition/ns/servicename instead of the reverse

This commit is contained in:
Kyle Havlovitz 2022-03-24 12:16:05 -07:00
parent 1b654c9807
commit 0d5cbf6f30
1 changed files with 2 additions and 2 deletions

View File

@ -170,13 +170,13 @@ func getCatalogOverview(catalog *structs.CatalogContents) *structs.CatalogSummar
summarySort := func(slice []structs.HealthSummary) func(int, int) bool {
return func(i, j int) bool {
if slice[i].Name < slice[j].Name {
if slice[i].PartitionOrEmpty() < slice[j].PartitionOrEmpty() {
return true
}
if slice[i].NamespaceOrEmpty() < slice[j].NamespaceOrEmpty() {
return true
}
return slice[i].PartitionOrEmpty() < slice[j].PartitionOrEmpty()
return slice[i].Name < slice[j].Name
}
}
sort.Slice(summary.Nodes, summarySort(summary.Nodes))