Merge pull request #79082 from timoreimann/delete-unused-service-controller-load-balancer-name-method

Remove unused ServiceController.loadBalancerName method
This commit is contained in:
Kubernetes Prow Robot 2019-06-19 18:37:13 -07:00 committed by GitHub
commit 8d8c54bd73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -504,10 +504,6 @@ func (s *ServiceController) needsUpdate(oldService *v1.Service, newService *v1.S
return false 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) { func getPortsForLB(service *v1.Service) ([]*v1.ServicePort, error) {
var protocol v1.Protocol var protocol v1.Protocol

View File

@ -17,6 +17,7 @@ limitations under the License.
package service package service
import ( import (
"context"
"errors" "errors"
"fmt" "fmt"
"reflect" "reflect"
@ -360,7 +361,7 @@ func TestSyncLoadBalancerIfNeeded(t *testing.T) {
} }
if balancer == nil { if balancer == nil {
t.Errorf("Got no load balancer, expected one to be created") 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.Region != region ||
balancer.Ports[0].Port != tc.service.Spec.Ports[0].Port { balancer.Ports[0].Port != tc.service.Spec.Ports[0].Port {
t.Errorf("Created load balancer has incorrect parameters: %v", balancer) t.Errorf("Created load balancer has incorrect parameters: %v", balancer)