api: Fix registering of s3 endpoint peers properly (#4159)

We need to have local peer initialized properly
for listen bucket to work, current code did initialize
properly but the resulting code was initializing
peer on a wrong target v/s what listen bucket expected
it to be.

This regression came in de204a0a52

Fixes #4158
This commit is contained in:
Harshavardhana 2017-04-20 15:28:29 -07:00 committed by GitHub
parent f1d7780167
commit df346753e1

View File

@ -19,7 +19,6 @@ package cmd
import (
"encoding/json"
"fmt"
"net"
"path"
"sync"
@ -42,12 +41,8 @@ type s3Peers []s3Peer
// slice. The urls slice is assumed to be non-empty and free of nil
// values.
func makeS3Peers(endpoints EndpointList) (s3PeerList s3Peers) {
thisPeer := globalMinioAddr
if globalMinioHost == "" {
thisPeer = net.JoinHostPort("localhost", globalMinioPort)
}
s3PeerList = append(s3PeerList, s3Peer{
thisPeer,
globalMinioAddr,
&localBucketMetaState{ObjectAPI: newObjectLayerFn},
})