Mark ServiceLBNodePortControl as GA
This commit is contained in:
@@ -3892,7 +3892,6 @@ type ServiceSpec struct {
|
||||
// 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
|
||||
|
||||
|
@@ -136,11 +136,9 @@ func SetDefaults_Service(obj *v1.Service) {
|
||||
obj.Spec.InternalTrafficPolicy = &serviceInternalTrafficPolicyCluster
|
||||
}
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.ServiceLBNodePortControl) {
|
||||
if obj.Spec.Type == v1.ServiceTypeLoadBalancer {
|
||||
if obj.Spec.AllocateLoadBalancerNodePorts == nil {
|
||||
obj.Spec.AllocateLoadBalancerNodePorts = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.Spec.Type == v1.ServiceTypeLoadBalancer {
|
||||
if obj.Spec.AllocateLoadBalancerNodePorts == nil {
|
||||
obj.Spec.AllocateLoadBalancerNodePorts = utilpointer.BoolPtr(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -4685,10 +4685,8 @@ func ValidateService(service *core.Service) field.ErrorList {
|
||||
allErrs = append(allErrs, field.Forbidden(specPath.Child("allocateLoadBalancerNodePorts"), "may only be used when `type` is 'LoadBalancer'"))
|
||||
}
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.ServiceLBNodePortControl) {
|
||||
if service.Spec.Type == core.ServiceTypeLoadBalancer && service.Spec.AllocateLoadBalancerNodePorts == nil {
|
||||
allErrs = append(allErrs, field.Required(field.NewPath("allocateLoadBalancerNodePorts"), ""))
|
||||
}
|
||||
if service.Spec.Type == core.ServiceTypeLoadBalancer && service.Spec.AllocateLoadBalancerNodePorts == nil {
|
||||
allErrs = append(allErrs, field.Required(field.NewPath("allocateLoadBalancerNodePorts"), ""))
|
||||
}
|
||||
|
||||
// validate LoadBalancerClass field
|
||||
|
Reference in New Issue
Block a user