Implement multi-port Endpoints
This is a part of multi-port services.
This commit is contained in:
@@ -69,7 +69,8 @@ type tcpProxySocket struct {
|
||||
|
||||
func tryConnect(service string, srcAddr net.Addr, protocol string, proxier *Proxier) (out net.Conn, err error) {
|
||||
for _, retryTimeout := range endpointDialTimeout {
|
||||
endpoint, err := proxier.loadBalancer.NextEndpoint(service, srcAddr)
|
||||
// TODO: support multiple service ports
|
||||
endpoint, err := proxier.loadBalancer.NextEndpoint(service, "", srcAddr)
|
||||
if err != nil {
|
||||
glog.Errorf("Couldn't find an endpoint for %s: %v", service, err)
|
||||
return nil, err
|
||||
@@ -383,7 +384,8 @@ func (proxier *Proxier) ensurePortals() {
|
||||
func (proxier *Proxier) cleanupStaleStickySessions() {
|
||||
for name, info := range proxier.serviceMap {
|
||||
if info.sessionAffinityType != api.AffinityTypeNone {
|
||||
proxier.loadBalancer.CleanupStaleStickySessions(name)
|
||||
// TODO: support multiple service ports
|
||||
proxier.loadBalancer.CleanupStaleStickySessions(name, "")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -499,7 +501,8 @@ func (proxier *Proxier) OnUpdate(services []api.Service) {
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to open portal for %q: %v", service.Name, err)
|
||||
}
|
||||
proxier.loadBalancer.NewService(service.Name, info.sessionAffinityType, info.stickyMaxAgeMinutes)
|
||||
// TODO: support multiple service ports
|
||||
proxier.loadBalancer.NewService(service.Name, "", info.sessionAffinityType, info.stickyMaxAgeMinutes)
|
||||
}
|
||||
proxier.mu.Lock()
|
||||
defer proxier.mu.Unlock()
|
||||
|
Reference in New Issue
Block a user