From a559de63dd8d8719e29ae334a172d43c26bcfc15 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Thu, 24 Mar 2022 12:16:05 -0700 Subject: [PATCH] Sort by partition/ns/servicename instead of the reverse --- agent/consul/server_overview.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/consul/server_overview.go b/agent/consul/server_overview.go index 7417f80324..b75ffed5d6 100644 --- a/agent/consul/server_overview.go +++ b/agent/consul/server_overview.go @@ -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))