Fix small bug with AllocateLoadBalancerNodePorts

If the user specified a port, DO reserve it, even if they asked you not
to allocate new ports.
This commit is contained in:
Tim Hockin
2021-07-04 14:49:44 -07:00
parent 59e5b849c9
commit eae4a19bd3
7 changed files with 79 additions and 36 deletions

View File

@@ -3731,11 +3731,13 @@ type ServiceSpec struct {
PublishNotReadyAddresses bool
// allocateLoadBalancerNodePorts defines if NodePorts will be automatically
// allocated for services with type LoadBalancer. Default is "true". It may be
// set to "false" if the cluster load-balancer does not rely on NodePorts.
// allocateLoadBalancerNodePorts may only be set for services with type LoadBalancer
// and will be cleared if the type is changed to any other type.
// This field is alpha-level and is only honored by servers that enable the ServiceLBNodePortControl feature.
// allocated for services with type LoadBalancer. Default is "true". It
// may be set to "false" if the cluster load-balancer does not rely on
// NodePorts. If the caller requests specific NodePorts (by specifying a
// value), those requests will be respected, regardless of this field.
// This field may only be set for services with type LoadBalancer and will
// be cleared if the type is changed to any other type.
// This field is beta-level and is only honored by servers that enable the ServiceLBNodePortControl feature.
// +optional
AllocateLoadBalancerNodePorts *bool