From e5070f035f02c7fdf178e920dc24ccf6fd2a9344 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 26 Feb 2018 14:34:15 +0100 Subject: [PATCH] no need to use additional group for synchronization. (#116) --- cmd/controller/main.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cmd/controller/main.go b/cmd/controller/main.go index dfe1bb678..24bc02ba8 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -335,16 +335,8 @@ func startControllerViaLeaderElection(runOptions controllerRunOptions) error { } go le.Run() - var g run.Group - { - g.Add(func() error { - <-runOptions.parentCtx.Done() - return errors.New("closing the app because leadership position was lost") - }, func(err error) { - runOptions.parentCtxDone() - }) - } - return g.Run() + <-runOptions.parentCtx.Done() + return nil } // createUtilHttpServer creates a new HTTP server