Skip to content

Commit 79a8827

Browse files
authored
Merge pull request kubernetes#76108 from MrHohn/svc-controller-sync-name
Rename createLoadBalancerIfNeeded() to syncLoadBalancerIfNeeded()
2 parents 3e71348 + 3e52ea8 commit 79a8827

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/controller/service/service_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func (s *ServiceController) processServiceUpdate(cachedService *cachedService, s
248248
}
249249
// cache the service, we need the info for service deletion
250250
cachedService.state = service
251-
err := s.createLoadBalancerIfNeeded(key, service)
251+
err := s.syncLoadBalancerIfNeeded(key, service)
252252
if err != nil {
253253
eventType := "CreatingLoadBalancerFailed"
254254
message := "Error creating load balancer (will retry): "
@@ -269,10 +269,10 @@ func (s *ServiceController) processServiceUpdate(cachedService *cachedService, s
269269
return nil
270270
}
271271

272-
// createLoadBalancerIfNeeded ensures that service's status is synced up with loadbalancer
272+
// syncLoadBalancerIfNeeded ensures that service's status is synced up with loadbalancer
273273
// i.e. creates loadbalancer for service if requested and deletes loadbalancer if the service
274274
// doesn't want a loadbalancer no more. Returns whatever error occurred.
275-
func (s *ServiceController) createLoadBalancerIfNeeded(key string, service *v1.Service) error {
275+
func (s *ServiceController) syncLoadBalancerIfNeeded(key string, service *v1.Service) error {
276276
// Note: It is safe to just call EnsureLoadBalancer. But, on some clouds that requires a delete & create,
277277
// which may involve service interruption. Also, we would like user-friendly events.
278278

pkg/controller/service/service_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func TestCreateExternalLoadBalancer(t *testing.T) {
151151

152152
for _, item := range table {
153153
controller, cloud, client := newController()
154-
err := controller.createLoadBalancerIfNeeded("foo/bar", item.service)
154+
err := controller.syncLoadBalancerIfNeeded("foo/bar", item.service)
155155
if !item.expectErr && err != nil {
156156
t.Errorf("unexpected error: %v", err)
157157
} else if item.expectErr && err == nil {

0 commit comments

Comments
 (0)