From 6cc9ef3874369b64cfe3107c12a527737b1dfd20 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 25 Nov 2020 00:31:07 -0800 Subject: [PATCH] Svc REST: Rename a long, hard function name --- pkg/registry/core/service/storage/rest.go | 6 +++--- pkg/registry/core/service/storage/rest_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/registry/core/service/storage/rest.go b/pkg/registry/core/service/storage/rest.go index 52e8f199020..ba429b0e087 100644 --- a/pkg/registry/core/service/storage/rest.go +++ b/pkg/registry/core/service/storage/rest.go @@ -185,7 +185,7 @@ func (al *RESTAllocStuff) allocateCreate(service *api.Service, dryRun bool) (tra // Ensure IP family fields are correctly initialized. We do it here, since // we want this to be visible even when dryRun == true. - if err := al.tryDefaultValidateServiceClusterIPFields(nil, service); err != nil { + if err := al.initIPFamilyFields(nil, service); err != nil { return nil, err } @@ -395,7 +395,7 @@ func (rs *REST) Update(ctx context.Context, name string, objInfo rest.UpdatedObj defer nodePortOp.Finish() // try set ip families (for missing ip families) - if err := rs.alloc.tryDefaultValidateServiceClusterIPFields(oldService, service); err != nil { + if err := rs.alloc.initIPFamilyFields(oldService, service); err != nil { return nil, false, err } @@ -874,7 +874,7 @@ func isMatchingPreferDualStackClusterIPFields(oldService, service *api.Service) // attempts to default service ip families according to cluster configuration // while ensuring that provided families are configured on cluster. -func (al *RESTAllocStuff) tryDefaultValidateServiceClusterIPFields(oldService, service *api.Service) error { +func (al *RESTAllocStuff) initIPFamilyFields(oldService, service *api.Service) error { // can not do anything here if service.Spec.Type == api.ServiceTypeExternalName { return nil diff --git a/pkg/registry/core/service/storage/rest_test.go b/pkg/registry/core/service/storage/rest_test.go index 9444a651d6a..ae3ef8b195a 100644 --- a/pkg/registry/core/service/storage/rest_test.go +++ b/pkg/registry/core/service/storage/rest_test.go @@ -3736,7 +3736,7 @@ func TestDefaultingValidation(t *testing.T) { testCase.modifyRest(storage) } - err := storage.alloc.tryDefaultValidateServiceClusterIPFields(testCase.oldSvc, testCase.svc) + err := storage.alloc.initIPFamilyFields(testCase.oldSvc, testCase.svc) if err != nil && !testCase.expectError { t.Fatalf("error %v was not expected", err) }