Query hostIP for instances

This commit is contained in:
Deyuan Deng 2014-12-05 23:26:33 -05:00
parent d03be4c0a2
commit 2ecea9ce7b

View File

@ -143,6 +143,12 @@ func (s *MinionController) cloudMinions() (*api.MinionList, error) {
}
for i := range matches {
result.Items[i].Name = matches[i]
hostIP, err := instances.IPAddress(matches[i])
if err != nil {
glog.Errorf("error getting instance ip address for %s: %v", matches[i], err)
} else {
result.Items[i].Status.HostIP = hostIP.String()
}
resources, err := instances.GetNodeResources(matches[i])
if err != nil {
return nil, err