Skip to content

Commit

Permalink
endpoint: Rename variable to remove collision w/ imported package (op…
Browse files Browse the repository at this point in the history
  • Loading branch information
draychev authored Nov 3, 2020
1 parent ddb7a4b commit dd937a3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/endpoint/providers/kube/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,25 +227,25 @@ func (c *Client) GetResolvableEndpointsForService(svc service.MeshService) ([]en
var err error

// Check if the service has been given Cluster IP
service := c.kubeController.GetService(svc)
if service == nil {
kubeService := c.kubeController.GetService(svc)
if kubeService == nil {
log.Error().Msgf("Could not find service %s", svc.String())
return nil, errServiceNotFound
}

if len(service.Spec.ClusterIP) == 0 {
if len(kubeService.Spec.ClusterIP) == 0 {
// If service has no cluster IP, use final endpoint as resolvable destinations
return c.ListEndpointsForService(svc), nil
}

// Cluster IP is present
ip := net.ParseIP(service.Spec.ClusterIP)
ip := net.ParseIP(kubeService.Spec.ClusterIP)
if ip == nil {
log.Error().Msgf("Could not parse Cluster IP %s", service.Spec.ClusterIP)
log.Error().Msgf("Could not parse Cluster IP %s", kubeService.Spec.ClusterIP)
return nil, errParseClusterIP
}

for _, svcPort := range service.Spec.Ports {
for _, svcPort := range kubeService.Spec.Ports {
endpoints = append(endpoints, endpoint.Endpoint{
IP: ip,
Port: endpoint.Port(svcPort.Port),
Expand Down

0 comments on commit dd937a3

Please sign in to comment.