remove duplicate validation on services

The rest api for services was validating that, on updates, both
the old and new service have the same type. That guarantees that
the type is going to be the same after that, thus we don't need
to validate the service type on the old and the new service.
This commit is contained in:
Antonio Ojea 2021-06-25 23:18:56 +02:00
parent 017b359770
commit fa7b5d86e6

View File

@ -882,12 +882,6 @@ func isMatchingPreferDualStackClusterIPFields(oldService, service *api.Service)
return false
}
if oldService.Spec.Type != api.ServiceTypeClusterIP &&
oldService.Spec.Type != api.ServiceTypeNodePort &&
oldService.Spec.Type != api.ServiceTypeLoadBalancer {
return false
}
// both must be of IPFamilyPolicy==PreferDualStack
if service.Spec.IPFamilyPolicy != nil && *(service.Spec.IPFamilyPolicy) != api.IPFamilyPolicyPreferDualStack {
return false