print stork leader deatails in logs
@@ -372,6 +372,7 @@ func run(c *cli.Context) {
OnStoppedLeading: func() {
log.Fatalf("Stork lost master")
},
+ OnNewLeader: displayLeader,
},
}
leaderElector, err := leaderelection.NewLeaderElector(leaderElectionConfig)
@@ -384,6 +385,10 @@ func run(c *cli.Context) {
}
}
+func displayLeader(name string) {
+ log.Infof("new leader detected, current leader: %s", name)
+}
+
func runStork(mgr manager.Manager, d volume.Driver, recorder record.EventRecorder, c *cli.Context) {
signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)
