diff --git a/pkg/cloudprovider/mesos/mesos.go b/pkg/cloudprovider/mesos/mesos.go index 8df50beefde..7334f8560a2 100644 --- a/pkg/cloudprovider/mesos/mesos.go +++ b/pkg/cloudprovider/mesos/mesos.go @@ -114,7 +114,7 @@ func (c *MesosCloud) ListClusters() ([]string, error) { return []string{name}, err } -// Master gets back the address (either DNS name or IP address) of the master node for the cluster. +// Master gets back the address (either DNS name or IP address) of the leading Mesos master node for the cluster. func (c *MesosCloud) Master(clusterName string) (string, error) { clusters, err := c.ListClusters() if err != nil { @@ -138,7 +138,7 @@ func (c *MesosCloud) Master(clusterName string) (string, error) { } // ipAddress returns an IP address of the specified instance. -func (c *MesosCloud) ipAddress(name string) (net.IP, error) { +func ipAddress(name string) (net.IP, error) { if name == "" { return nil, noHostNameSpecified } @@ -158,7 +158,7 @@ func (c *MesosCloud) ipAddress(name string) (net.IP, error) { // ExternalID returns the cloud provider ID of the specified instance. func (c *MesosCloud) ExternalID(instance string) (string, error) { - ip, err := c.ipAddress(instance) + ip, err := ipAddress(instance) if err != nil { return "", err } @@ -218,7 +218,7 @@ func (c *MesosCloud) GetNodeResources(name string) (*api.NodeResources, error) { // NodeAddresses returns the addresses of the specified instance. func (c *MesosCloud) NodeAddresses(name string) ([]api.NodeAddress, error) { - ip, err := c.ipAddress(name) + ip, err := ipAddress(name) if err != nil { return nil, err } diff --git a/pkg/cloudprovider/mesos/mesos_test.go b/pkg/cloudprovider/mesos/mesos_test.go index b6503faff8f..d27dfa28027 100644 --- a/pkg/cloudprovider/mesos/mesos_test.go +++ b/pkg/cloudprovider/mesos/mesos_test.go @@ -28,9 +28,8 @@ import ( ) func TestIPAddress(t *testing.T) { - c := &MesosCloud{} expected4 := net.IPv4(127, 0, 0, 1) - ip, err := c.ipAddress("127.0.0.1") + ip, err := ipAddress("127.0.0.1") if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -42,7 +41,7 @@ func TestIPAddress(t *testing.T) { if expected6 == nil { t.Fatalf("failed to parse ipv6 ::1") } - ip, err = c.ipAddress("::1") + ip, err = ipAddress("::1") if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -50,7 +49,7 @@ func TestIPAddress(t *testing.T) { t.Fatalf("expected %#v instead of %#v", expected6, ip) } - ip, err = c.ipAddress("localhost") + ip, err = ipAddress("localhost") if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -58,7 +57,7 @@ func TestIPAddress(t *testing.T) { t.Fatalf("expected %#v or %#v instead of %#v", expected4, expected6, ip) } - _, err = c.ipAddress("") + _, err = ipAddress("") if err != noHostNameSpecified { t.Fatalf("expected error noHostNameSpecified but got none") }