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
Signed-off-by: Delyan Raychev <[email protected]>
  • Loading branch information
draychev committed Jul 15, 2021
1 parent 928985f commit d67004b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/config/v1alpha1/multi_cluster_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestMultiClusterServiceStringer(t *testing.T) {
},

Spec: MultiClusterServiceSpec{
Cluster: []ClusterSpec{
Clusters: []ClusterSpec{
{
Address: "1.2.3.4:8080",
Name: "remote-cluster-1",
Expand Down
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.Clusters {
for _, svc := range services {
for _, cluster := range svc.Spec.Clusters {
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 d67004b

Please sign in to comment.