Change cloud provider CreateTCPLoadBalancer to return endpoint as string

Some load balancers (particularly AWS ELB) define the public endpoint
as a hostname (instead of using IP addresses).

This is a partial fix for #5224; there will also be some proxy work.
This commit is contained in:
Justin Santa Barbara
2015-03-09 20:31:57 -07:00
parent a4d871a100
commit 5d36d3cdbe
6 changed files with 24 additions and 21 deletions

View File

@@ -272,11 +272,11 @@ func (rs *REST) createExternalLoadBalancer(ctx api.Context, service *api.Service
}
}
} else {
ip, err := balancer.CreateTCPLoadBalancer(name, zone.Region, nil, service.Spec.Port, hostsFromMinionList(hosts), affinityType)
endpoint, err := balancer.CreateTCPLoadBalancer(name, zone.Region, nil, service.Spec.Port, hostsFromMinionList(hosts), affinityType)
if err != nil {
return err
}
service.Spec.PublicIPs = []string{ip.String()}
service.Spec.PublicIPs = []string{endpoint}
}
return nil
}