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
master
Harshavardhana 8 years ago committed by GitHub
parent f1d7780167
commit df346753e1
  1. 7
      cmd/s3-peer-client.go

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

Loading…
Cancel
Save