Order mc admin info output by endpoint (#3804)

To make easy for users to navigate through the list of servers.
This commit is contained in:
Anis Elleuch
2021-09-21 09:08:28 -07:00
committed by GitHub
parent a8bf2a463b
commit 4e4c912b37
+5
View File
@@ -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),