Fix problems identified in review

This commit is contained in:
Justin Santa Barbara 2015-03-13 18:07:08 -04:00
parent bc16d83a51
commit 99da56fb06
4 changed files with 6 additions and 6 deletions

View File

@ -57,7 +57,7 @@ type TCPLoadBalancer interface {
// Instances is an abstract, pluggable interface for sets of instances.
type Instances interface {
// IPAddress returns an IP address of the specified instance.
// NodeAddresses returns the addresses of the specified instance.
NodeAddresses(name string) ([]api.NodeAddress, error)
// ExternalID returns the cloud provider ID of the specified instance.
ExternalID(name string) (string, error)

View File

@ -274,7 +274,7 @@ func (s *NodeController) PopulateAddresses(nodes *api.NodeList) (*api.NodeList,
if err != nil {
glog.Errorf("error getting instance addresses for %s: %v", node.Name, err)
} else {
api.AddToNodeAddresses(&node.Status.Addresses, nodeAddresses...)
node.Status.Addresses = nodeAddresses
}
}
} else {
@ -283,7 +283,7 @@ func (s *NodeController) PopulateAddresses(nodes *api.NodeList) (*api.NodeList,
addr := net.ParseIP(node.Name)
if addr != nil {
address := api.NodeAddress{Type: api.NodeLegacyHostIP, Address: addr.String()}
api.AddToNodeAddresses(&node.Status.Addresses, address)
node.Status.Addresses = []api.NodeAddress{address}
} else {
addrs, err := s.lookupIP(node.Name)
if err != nil {
@ -292,7 +292,7 @@ func (s *NodeController) PopulateAddresses(nodes *api.NodeList) (*api.NodeList,
glog.Errorf("No ip address for node %v", node.Name)
} else {
address := api.NodeAddress{Type: api.NodeLegacyHostIP, Address: addrs[0].String()}
api.AddToNodeAddresses(&node.Status.Addresses, address)
node.Status.Addresses = []api.NodeAddress{address}
}
}
}

View File

@ -118,7 +118,7 @@ func (f *FakeCloud) DeleteTCPLoadBalancer(name, region string) error {
// NodeAddresses is a test-spy implementation of Instances.NodeAddresses.
// It adds an entry "node-addresses" into the internal method call record.
func (f *FakeCloud) NodeAddresses(instance string) ([]api.NodeAddress, error) {
f.addCall("ip-address")
f.addCall("node-addresses")
return f.Addresses, f.Err
}

View File

@ -119,7 +119,7 @@ func (v *VagrantCloud) getInstanceByAddress(address string) (*SaltMinion, error)
return nil, fmt.Errorf("unable to find instance for address: %s", address)
}
// NodeAddresses returns the NodeAddress of a particular machine instance.
// NodeAddresses returns the NodeAddresses of a particular machine instance.
func (v *VagrantCloud) NodeAddresses(instance string) ([]api.NodeAddress, error) {
// Due to vagrant not running with a dedicated DNS setup, we return the IP address of a minion as its hostname at this time
minion, err := v.getInstanceByAddress(instance)