From 4e4c912b37f1ddbf064ebc8297d4e872fbd31669 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Tue, 21 Sep 2021 17:08:28 +0100 Subject: [PATCH] Order mc admin info output by endpoint (#3804) To make easy for users to navigate through the list of servers. --- cmd/admin-info.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/admin-info.go b/cmd/admin-info.go index d4a33285..b8cb362e 100644 --- a/cmd/admin-info.go +++ b/cmd/admin-info.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" "reflect" + "sort" "strconv" "strings" "time" @@ -116,6 +117,10 @@ func (u clusterStruct) String() (msg string) { coloredDot = console.Colorize("InfoWarning", dot) } + sort.Slice(u.Info.Servers, func(i, j int) bool { + return u.Info.Servers[i].Endpoint < u.Info.Servers[j].Endpoint + }) + // Loop through each server and put together info for each one for _, srv := range u.Info.Servers { // Check if MinIO server is offline ("Mode" field),