Merge pull request #19863 from justinsb/aws_fix_loadbalancer_tcp_check

AWS: Eliminate assumptions about all load-balancer ports matching
This commit is contained in:
Alex Mohr 2016-01-21 10:52:20 -08:00
commit f64a40f315

View File

@ -1717,9 +1717,10 @@ func (s *AWSCloud) EnsureLoadBalancer(name, region string, publicIP net.IP, port
return nil, fmt.Errorf("requested load balancer with no ports") return nil, fmt.Errorf("requested load balancer with no ports")
} }
// The service controller verified all the protocols match on the ports, just check and use the first one for _, port := range ports {
if ports[0].Protocol != api.ProtocolTCP { if port.Protocol != api.ProtocolTCP {
return nil, fmt.Errorf("Only TCP LoadBalancer is supported for AWS ELB") return nil, fmt.Errorf("Only TCP LoadBalancer is supported for AWS ELB")
}
} }
if publicIP != nil { if publicIP != nil {