Skip to content

Commit

Permalink
Exit when losing leadership
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Jul 7, 2019
1 parent b1bb9fa commit 266fc92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 2 additions & 1 deletion cmd/flagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ func startLeaderElection(ctx context.Context, run func(), ns string, kubeClient
run()
},
OnStoppedLeading: func() {
logger.Infof("Leader election lost")
logger.Infof("Leadership lost")
os.Exit(1)
},
OnNewLeader: func(identity string) {
if identity != id {
Expand Down
9 changes: 0 additions & 9 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,6 @@ func (c *Controller) syncHandler(key string) error {
}

c.canaries.Store(fmt.Sprintf("%s.%s", cd.Name, cd.Namespace), cd)

//if cd.Spec.TargetRef.Kind == "Deployment" {
// err = c.bootstrapDeployment(cd)
// if err != nil {
// c.logger.Warnf("%s.%s bootstrap error %v", cd.Name, cd.Namespace, err)
// return err
// }
//}

c.logger.Infof("Synced %s", key)

return nil
Expand Down

0 comments on commit 266fc92

Please sign in to comment.