@@ -244,14 +244,8 @@ func NewLoadBalancerController(input NewLoadBalancerControllerInput) *LoadBalanc
244
244
lbc .syncQueue .enqueue (curSvc )
245
245
return
246
246
}
247
- // attempt to avoid enqueuing the ingress for this service
248
- oldSvc := old .(* api_v1.Service )
249
- if ! reflect .DeepEqual (curSvc .Spec .Ports , oldSvc .Spec .Ports ) ||
250
- ! reflect .DeepEqual (curSvc .Spec .Type , oldSvc .Spec .Type ) {
251
- glog .V (3 ).Infof ("Service %v changed, syncing" , curSvc .Name )
252
- lbc .enqueueIngressForService (curSvc )
253
- }
254
-
247
+ glog .V (3 ).Infof ("Service %v changed, syncing" , curSvc .Name )
248
+ lbc .enqueueIngressForService (curSvc )
255
249
}
256
250
},
257
251
}
@@ -444,7 +438,7 @@ func (lbc *LoadBalancerController) syncEndp(task Task) {
444
438
ings := lbc .getIngressForEndpoints (obj )
445
439
446
440
var ingExes []* nginx.IngressEx
447
- var mergableIngressesBatch []* nginx.MergeableIngresses
441
+ var mergableIngressesSlice []* nginx.MergeableIngresses
448
442
449
443
for i := range ings {
450
444
if ! lbc .isNginxIngress (& ings [i ]) {
@@ -456,7 +450,7 @@ func (lbc *LoadBalancerController) syncEndp(task Task) {
456
450
glog .Errorf ("Ignoring Ingress %v(Minion): %v" , ings [i ].Name , err )
457
451
continue
458
452
}
459
- if ! lbc .cnf .HasIngress (master ) {
453
+ if ! lbc .cnf .HasMinion (master , & ings [ i ] ) {
460
454
continue
461
455
}
462
456
mergeableIngresses , err := lbc .createMergableIngresses (master )
@@ -465,7 +459,7 @@ func (lbc *LoadBalancerController) syncEndp(task Task) {
465
459
continue
466
460
}
467
461
468
- mergableIngressesBatch = append (mergableIngressesBatch , mergeableIngresses )
462
+ mergableIngressesSlice = append (mergableIngressesSlice , mergeableIngresses )
469
463
continue
470
464
}
471
465
if ! lbc .cnf .HasIngress (& ings [i ]) {
@@ -480,19 +474,20 @@ func (lbc *LoadBalancerController) syncEndp(task Task) {
480
474
ingExes = append (ingExes , ingEx )
481
475
}
482
476
483
- if len (ingExes ) == 0 {
484
- return
477
+ if len (ingExes ) > 0 {
478
+ glog .V (3 ).Infof ("Updating Endpoints for %v" , ingExes )
479
+ err = lbc .cnf .UpdateEndpoints (ingExes )
480
+ if err != nil {
481
+ glog .Errorf ("Error updating endpoints for %v: %v" , ingExes , err )
482
+ }
485
483
}
486
484
487
- glog .V (3 ).Infof ("Updating Endpoints for %v" , ingExes )
488
- lbc .cnf .UpdateEndpoints (ingExes )
489
- if err != nil {
490
- glog .Errorf ("Error updating endpoints for %v: %v" , ingExes , err )
491
- }
492
- glog .V (3 ).Infof ("Updating Endpoints for %v" , mergableIngressesBatch )
493
- err = lbc .cnf .UpdateEndpointsMergeableIngress (mergableIngressesBatch )
494
- if err != nil {
495
- glog .Errorf ("Error updating endpoints for %v: %v" , mergableIngressesBatch , err )
485
+ if len (mergableIngressesSlice ) > 0 {
486
+ glog .V (3 ).Infof ("Updating Endpoints for %v" , mergableIngressesSlice )
487
+ err = lbc .cnf .UpdateEndpointsMergeableIngress (mergableIngressesSlice )
488
+ if err != nil {
489
+ glog .Errorf ("Error updating endpoints for %v: %v" , mergableIngressesSlice , err )
490
+ }
496
491
}
497
492
}
498
493
}
@@ -1315,9 +1310,8 @@ func (lbc *LoadBalancerController) isNginxIngress(ing *extensions.Ingress) bool
1315
1310
return class == lbc .ingressClass
1316
1311
}
1317
1312
return class == lbc .ingressClass || class == ""
1318
- } else {
1319
- return ! lbc .useIngressClassOnly
1320
1313
}
1314
+ return ! lbc .useIngressClassOnly
1321
1315
}
1322
1316
1323
1317
// isHealthCheckEnabled checks if health checks are enabled so we can only query pods if enabled.
0 commit comments