mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Remove unused ServiceController.loadBalancerName method
Its only caller lives in the corresponding test file. Hence, we move the method called by loadBalancerName over to the test and remove loadBalancerName.
This commit is contained in:
parent
8f4cc7d81f
commit
77c9950098
@ -503,10 +503,6 @@ func (s *ServiceController) needsUpdate(oldService *v1.Service, newService *v1.S
|
||||
return false
|
||||
}
|
||||
|
||||
func (s *ServiceController) loadBalancerName(service *v1.Service) string {
|
||||
return s.balancer.GetLoadBalancerName(context.TODO(), "", service)
|
||||
}
|
||||
|
||||
func getPortsForLB(service *v1.Service) ([]*v1.ServicePort, error) {
|
||||
var protocol v1.Protocol
|
||||
|
||||
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
@ -360,7 +361,7 @@ func TestSyncLoadBalancerIfNeeded(t *testing.T) {
|
||||
}
|
||||
if balancer == nil {
|
||||
t.Errorf("Got no load balancer, expected one to be created")
|
||||
} else if balancer.Name != controller.loadBalancerName(tc.service) ||
|
||||
} else if balancer.Name != controller.balancer.GetLoadBalancerName(context.Background(), "", tc.service) ||
|
||||
balancer.Region != region ||
|
||||
balancer.Ports[0].Port != tc.service.Spec.Ports[0].Port {
|
||||
t.Errorf("Created load balancer has incorrect parameters: %v", balancer)
|
||||
|
Loading…
Reference in New Issue
Block a user