@@ -414,11 +414,10 @@ func (lbc *loadBalancerController) checkSvcForUpdate(svc *api.Service) (map[stri
414414 return namedPorts , nil
415415}
416416
417- func (lbc * loadBalancerController ) sync (key string ) {
417+ func (lbc * loadBalancerController ) sync (key string ) error {
418418 if ! lbc .controllersInSync () {
419419 time .Sleep (podStoreSyncedPollPeriod )
420- lbc .syncQueue .requeue (key , fmt .Errorf ("deferring sync till endpoints controller has synced" ))
421- return
420+ return fmt .Errorf ("deferring sync till endpoints controller has synced" )
422421 }
423422
424423 var cfg * api.ConfigMap
@@ -435,29 +434,28 @@ func (lbc *loadBalancerController) sync(key string) {
435434 ings := lbc .ingLister .Store .List ()
436435 upstreams , servers := lbc .getUpstreamServers (ngxConfig , ings )
437436
438- lbc .nginx .CheckAndReload (ngxConfig , nginx.IngressConfig {
437+ return lbc .nginx .CheckAndReload (ngxConfig , nginx.IngressConfig {
439438 Upstreams : upstreams ,
440439 Servers : servers ,
441440 TCPUpstreams : lbc .getTCPServices (),
442441 UDPUpstreams : lbc .getUDPServices (),
443442 })
444443}
445444
446- func (lbc * loadBalancerController ) updateIngressStatus (key string ) {
445+ func (lbc * loadBalancerController ) updateIngressStatus (key string ) error {
447446 if ! lbc .controllersInSync () {
448447 time .Sleep (podStoreSyncedPollPeriod )
449- lbc .ingQueue .requeue (key , fmt .Errorf ("deferring sync till endpoints controller has synced" ))
450- return
448+ return fmt .Errorf ("deferring sync till endpoints controller has synced" )
451449 }
452450
453451 obj , ingExists , err := lbc .ingLister .Store .GetByKey (key )
454452 if err != nil {
455- lbc .ingQueue .requeue (key , err )
456- return
453+ return err
457454 }
458455
459456 if ! ingExists {
460- return
457+ // TODO: what's the correct behavior here?
458+ return nil
461459 }
462460
463461 ing := obj .(* extensions.Ingress )
@@ -466,8 +464,7 @@ func (lbc *loadBalancerController) updateIngressStatus(key string) {
466464
467465 currIng , err := ingClient .Get (ing .Name )
468466 if err != nil {
469- glog .Errorf ("unexpected error searching Ingress %v/%v: %v" , ing .Namespace , ing .Name , err )
470- return
467+ return fmt .Errorf ("unexpected error searching Ingress %v/%v: %v" , ing .Namespace , ing .Name , err )
471468 }
472469
473470 lbIPs := ing .Status .LoadBalancer .Ingress
@@ -478,11 +475,13 @@ func (lbc *loadBalancerController) updateIngressStatus(key string) {
478475 })
479476 if _ , err := ingClient .UpdateStatus (currIng ); err != nil {
480477 lbc .recorder .Eventf (currIng , api .EventTypeWarning , "UPDATE" , "error: %v" , err )
481- return
478+ return err
482479 }
483480
484481 lbc .recorder .Eventf (currIng , api .EventTypeNormal , "CREATE" , "ip: %v" , lbc .podInfo .NodeIP )
485482 }
483+
484+ return nil
486485}
487486
488487func (lbc * loadBalancerController ) isStatusIPDefined (lbings []api.LoadBalancerIngress ) bool {
0 commit comments