mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Svc REST: Rename a long, hard function name
This commit is contained in:
parent
634055bded
commit
6cc9ef3874
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user