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
```
master
Harshavardhana 6 years ago committed by Nitish Tiwari
parent 9fb94e6aa8
commit 487ecedc51
  1. 4
      cmd/admin-rpc-client.go

@ -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,

Loading…
Cancel
Save