File tree 1 file changed +2
-8
lines changed
1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -199,21 +199,15 @@ func (m *mcManager) Add(r Runnable) (err error) {
199
199
// Engage gets called when the component should start operations for the given
200
200
// Cluster. ctx is cancelled when the cluster is disengaged.
201
201
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.
209
203
210
204
for _ , r := range m .mcRunnables {
211
205
if err := r .Engage (ctx , name , cl ); err != nil {
212
206
cancel ()
213
207
return fmt .Errorf ("failed to engage cluster %q: %w" , name , err )
214
208
}
215
209
}
216
- return nil
210
+ return nil //nolint:govet // cancel is called in the error case only.
217
211
}
218
212
219
213
func (m * mcManager ) GetManager (ctx context.Context , clusterName string ) (manager.Manager , error ) {
You can’t perform that action at this time.
0 commit comments