Skip to content

Commit

Permalink
Make gitops controller exit when leader lease is lost
Browse files Browse the repository at this point in the history
Fix #2138
  • Loading branch information
p-se committed Jul 4, 2024
1 parent 9e164ce commit 4b05efe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/cmd/controller/gitops/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ func (g *GitOperator) Run(cmd *cobra.Command, args []string) error {
ShardID: g.ShardID,
}

group := errgroup.Group{}
group, ctx := errgroup.WithContext(ctx)
group.Go(func() error {
return startWebhook(ctx, namespace, g.Listen, mgr.GetClient(), mgr.GetCache())
})
group.Go(func() error {
setupLog.Info("starting manager")

if err = reconciler.SetupWithManager(mgr); err != nil {
return err
}
Expand Down

0 comments on commit 4b05efe

Please sign in to comment.