Skip to content

Commit 5d532d9

Browse files
Undo changes to manager.go
1 parent 33eecc6 commit 5d532d9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pkg/manager/manager.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,15 @@ func (m *mcManager) Add(r Runnable) (err error) {
199199
// Engage gets called when the component should start operations for the given
200200
// Cluster. ctx is cancelled when the cluster is disengaged.
201201
func (m *mcManager) Engage(ctx context.Context, name string, cl cluster.Cluster) error {
202-
ctx, cancel := context.WithCancel(ctx)
203-
204-
// Create a goroutine that will clean up the cancel function when the parent context is done
205-
go func() {
206-
<-ctx.Done()
207-
cancel()
208-
}()
202+
ctx, cancel := context.WithCancel(ctx) //nolint:govet // cancel is called in the error case only.
209203

210204
for _, r := range m.mcRunnables {
211205
if err := r.Engage(ctx, name, cl); err != nil {
212206
cancel()
213207
return fmt.Errorf("failed to engage cluster %q: %w", name, err)
214208
}
215209
}
216-
return nil
210+
return nil //nolint:govet // cancel is called in the error case only.
217211
}
218212

219213
func (m *mcManager) GetManager(ctx context.Context, clusterName string) (manager.Manager, error) {

0 commit comments

Comments
 (0)