Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Renaming variable colliding with imported package name
Browse files Browse the repository at this point in the history
  • Loading branch information
draychev committed Jul 14, 2021
1 parent 7ef0c47 commit afda924
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/providers/kube/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,18 @@ func (c *Client) getMultiClusterServiceEndpointsForServiceAccount(serviceAccount
func getEndpointsFromMultiClusterServices(services []*v1alpha1.MultiClusterService) []endpoint.Endpoint {
endpoints := []endpoint.Endpoint{}
if len(services) > 0 {
for _, service := range services {
for _, cluster := range service.Spec.Cluster {
for _, svc := range services {
for _, cluster := range svc.Spec.Cluster {
tokens := strings.Split(cluster.Address, ":")
if len(tokens) != 2 {
log.Error().Msgf("Error parsing remote service %s address %s. It should have IP address and port number", service.Name, cluster.Address)
log.Error().Msgf("Error parsing remote service %s address %s. It should have IP address and port number", svc.Name, cluster.Address)
continue
}

ip, portStr := tokens[0], tokens[1]
port, err := strconv.Atoi(portStr)
if err != nil {
log.Error().Msgf("Remote service %s port number format invalid. Remote cluster address: %s", service.Name, cluster.Address)
log.Error().Msgf("Remote service %s port number format invalid. Remote cluster address: %s", svc.Name, cluster.Address)
continue
}

Expand Down

0 comments on commit afda924

Please sign in to comment.