Return an error if a user attempts to create an externalized UDP balancer.

This commit is contained in:
Brendan Burns 2014-12-10 17:13:54 -08:00
parent 5523e0344a
commit bac915a066

View File

@ -114,6 +114,10 @@ func (rs *REST) Create(ctx api.Context, obj runtime.Object) (<-chan apiserver.RE
if rs.cloud == nil { if rs.cloud == nil {
return nil, fmt.Errorf("requested an external service, but no cloud provider supplied.") return nil, fmt.Errorf("requested an external service, but no cloud provider supplied.")
} }
if service.Spec.Protocol != api.ProtocolTCP {
// TODO: Support UDP here too.
return nil, fmt.Errorf("external load balancers for non TCP services are not currently supported.")
}
balancer, ok := rs.cloud.TCPLoadBalancer() balancer, ok := rs.cloud.TCPLoadBalancer()
if !ok { if !ok {
return nil, fmt.Errorf("the cloud provider does not support external TCP load balancers.") return nil, fmt.Errorf("the cloud provider does not support external TCP load balancers.")