Promote ServiceInternalTrafficPolicy to GA
This commit is contained in:
@@ -4876,14 +4876,12 @@ func validateServiceExternalTrafficFieldsUpdate(before, after *core.Service) fie
|
||||
func validateServiceInternalTrafficFieldsValue(service *core.Service) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) {
|
||||
if service.Spec.InternalTrafficPolicy == nil {
|
||||
// We do not forbid internalTrafficPolicy on other Service types because of historical reasons.
|
||||
// We did not check that before it went beta and we don't want to invalidate existing stored objects.
|
||||
if service.Spec.Type == core.ServiceTypeNodePort ||
|
||||
service.Spec.Type == core.ServiceTypeLoadBalancer || service.Spec.Type == core.ServiceTypeClusterIP {
|
||||
allErrs = append(allErrs, field.Required(field.NewPath("spec").Child("internalTrafficPolicy"), ""))
|
||||
}
|
||||
if service.Spec.InternalTrafficPolicy == nil {
|
||||
// We do not forbid internalTrafficPolicy on other Service types because of historical reasons.
|
||||
// We did not check that before it went beta and we don't want to invalidate existing stored objects.
|
||||
if service.Spec.Type == core.ServiceTypeNodePort ||
|
||||
service.Spec.Type == core.ServiceTypeLoadBalancer || service.Spec.Type == core.ServiceTypeClusterIP {
|
||||
allErrs = append(allErrs, field.Required(field.NewPath("spec").Child("internalTrafficPolicy"), ""))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user