Skip to content

Commit

Permalink
Fix possible panic in leader election
Browse files Browse the repository at this point in the history
A panic could occur if the Ingress Controller lost its leadership.
That happened because OnStoppedLeading() callback was not
implemented. The bug appeared after updating k8s.io/client-go
to 9.0.0.
  • Loading branch information
pleshakov committed Nov 9, 2018
1 parent 672de59 commit e3f5224
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/handlers/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ func CreateLeaderHandler(lbc *controller.LoadBalancerController) leaderelection.
glog.V(3).Infof("error updating status when starting leading: %v", err)
}
},
OnStoppedLeading: func() {
glog.V(3).Info("stopped leading")
},
}
}

0 comments on commit e3f5224

Please sign in to comment.