From fa7b5d86e6346d3bdafd5afc250de8e40ea0520c Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Fri, 25 Jun 2021 23:18:56 +0200 Subject: [PATCH] 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. --- pkg/registry/core/service/storage/rest.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkg/registry/core/service/storage/rest.go b/pkg/registry/core/service/storage/rest.go index 0faa738e597..a2c1a119bfd 100644 --- a/pkg/registry/core/service/storage/rest.go +++ b/pkg/registry/core/service/storage/rest.go @@ -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