fix admin info peer to point to first endpoint (#5996)

The current problem is that when you invoke

```
mc admin info myminio | head -1
●  localhost:9000
```

This output is incorrect as the expected output should be
```
mc admin info myminio | head -1
●  192.168.1.17:9000
```
This commit is contained in:
Harshavardhana 2018-05-30 20:22:21 -07:00 committed by Nitish Tiwari
parent 9fb94e6aa8
commit 487ecedc51

View File

@ -256,7 +256,9 @@ type adminPeers []adminPeer
func makeAdminPeers(endpoints EndpointList) (adminPeerList adminPeers) {
thisPeer := globalMinioAddr
if globalMinioHost == "" {
thisPeer = net.JoinHostPort("localhost", globalMinioPort)
// When host is not explicitly provided simply
// use the first IPv4.
thisPeer = net.JoinHostPort(sortIPs(localIP4.ToSlice())[0], globalMinioPort)
}
adminPeerList = append(adminPeerList, adminPeer{
thisPeer,