diff --git a/pkg/cloudprovider/cloud.go b/pkg/cloudprovider/cloud.go index 03132aabb41..733d917dbb4 100644 --- a/pkg/cloudprovider/cloud.go +++ b/pkg/cloudprovider/cloud.go @@ -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) diff --git a/pkg/cloudprovider/controller/nodecontroller.go b/pkg/cloudprovider/controller/nodecontroller.go index 9a11a1bba81..8e7f2e91d9f 100644 --- a/pkg/cloudprovider/controller/nodecontroller.go +++ b/pkg/cloudprovider/controller/nodecontroller.go @@ -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} } } } diff --git a/pkg/cloudprovider/fake/fake.go b/pkg/cloudprovider/fake/fake.go index e773041e24b..46cbfaffbc6 100644 --- a/pkg/cloudprovider/fake/fake.go +++ b/pkg/cloudprovider/fake/fake.go @@ -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 } diff --git a/pkg/cloudprovider/vagrant/vagrant.go b/pkg/cloudprovider/vagrant/vagrant.go index ecd3094b7d0..9672ba43b49 100644 --- a/pkg/cloudprovider/vagrant/vagrant.go +++ b/pkg/cloudprovider/vagrant/vagrant.go @@ -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)