Implement bucket expansion (#8509)

This commit is contained in:
Harshavardhana
2019-11-19 17:42:27 -08:00
committed by kannappanr
parent 3a34d98db8
commit 347b29d059
63 changed files with 2208 additions and 1166 deletions

View File

@@ -120,10 +120,10 @@ func (n byLastOctetValue) Less(i, j int) bool {
// This case is needed when all ips in the list
// have same last octets, Following just ensures that
// 127.0.0.1 is moved to the end of the list.
if n[i].String() == "127.0.0.1" {
if n[i].IsLoopback() {
return false
}
if n[j].String() == "127.0.0.1" {
if n[j].IsLoopback() {
return true
}
return []byte(n[i].To4())[3] > []byte(n[j].To4())[3]
@@ -171,7 +171,8 @@ func getAPIEndpoints() (apiEndpoints []string) {
}
for _, ip := range ipList {
apiEndpoints = append(apiEndpoints, fmt.Sprintf("%s://%s", getURLScheme(globalIsSSL), net.JoinHostPort(ip, globalMinioPort)))
endpoint := fmt.Sprintf("%s://%s", getURLScheme(globalIsSSL), net.JoinHostPort(ip, globalMinioPort))
apiEndpoints = append(apiEndpoints, endpoint)
}
return apiEndpoints