From 487ecedc519097af63876a473c00b284c4170af6 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 30 May 2018 20:22:21 -0700 Subject: [PATCH] fix admin info peer to point to first endpoint (#5996) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 ``` --- cmd/admin-rpc-client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/admin-rpc-client.go b/cmd/admin-rpc-client.go index b6b5affc9..a7ccdc770 100644 --- a/cmd/admin-rpc-client.go +++ b/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,