mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
server: Sort ips based on their last octet value. (#2198)
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
8c84df5e74
commit
0bd6b67ca5
@@ -21,7 +21,6 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -140,13 +139,14 @@ func finalizeEndpoints(tls bool, apiServer *http.Server) (endPoints []string) {
|
||||
scheme = "https"
|
||||
}
|
||||
|
||||
ips := getIPsFromHosts(hosts)
|
||||
|
||||
// Construct proper endpoints.
|
||||
for _, host := range hosts {
|
||||
endPoints = append(endPoints, fmt.Sprintf("%s://%s:%s", scheme, host, port))
|
||||
for _, ip := range ips {
|
||||
endPoints = append(endPoints, fmt.Sprintf("%s://%s:%s", scheme, ip.String(), port))
|
||||
}
|
||||
|
||||
// Success.
|
||||
sort.Strings(endPoints)
|
||||
return endPoints
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user