mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +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
|
// Ensure IP family fields are correctly initialized. We do it here, since
|
||||||
// we want this to be visible even when dryRun == true.
|
// 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
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ func (rs *REST) Update(ctx context.Context, name string, objInfo rest.UpdatedObj
|
|||||||
defer nodePortOp.Finish()
|
defer nodePortOp.Finish()
|
||||||
|
|
||||||
// try set ip families (for missing ip families)
|
// 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
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -874,7 +874,7 @@ func isMatchingPreferDualStackClusterIPFields(oldService, service *api.Service)
|
|||||||
|
|
||||||
// attempts to default service ip families according to cluster configuration
|
// attempts to default service ip families according to cluster configuration
|
||||||
// while ensuring that provided families are configured on cluster.
|
// 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
|
// can not do anything here
|
||||||
if service.Spec.Type == api.ServiceTypeExternalName {
|
if service.Spec.Type == api.ServiceTypeExternalName {
|
||||||
return nil
|
return nil
|
||||||
|
@ -3736,7 +3736,7 @@ func TestDefaultingValidation(t *testing.T) {
|
|||||||
testCase.modifyRest(storage)
|
testCase.modifyRest(storage)
|
||||||
}
|
}
|
||||||
|
|
||||||
err := storage.alloc.tryDefaultValidateServiceClusterIPFields(testCase.oldSvc, testCase.svc)
|
err := storage.alloc.initIPFamilyFields(testCase.oldSvc, testCase.svc)
|
||||||
if err != nil && !testCase.expectError {
|
if err != nil && !testCase.expectError {
|
||||||
t.Fatalf("error %v was not expected", err)
|
t.Fatalf("error %v was not expected", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user