From e3f5224d9d6c87b17e0b56d09760b52c842f7ea3 Mon Sep 17 00:00:00 2001 From: Michael Pleshakov Date: Wed, 7 Nov 2018 18:07:45 +0000 Subject: [PATCH] Fix possible panic in leader election 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. --- internal/handlers/leader.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/handlers/leader.go b/internal/handlers/leader.go index a885e347e9..52e74795e9 100644 --- a/internal/handlers/leader.go +++ b/internal/handlers/leader.go @@ -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") + }, } }