Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Commit

Permalink
prevent multiple go routines for same machine object when labeling
Browse files Browse the repository at this point in the history
```improvement operator
Fixed an issue that may cause panics when the machines are labeled for forceful deletion.
```
  • Loading branch information
rfranzke committed Jun 13, 2019
1 parent e2255ed commit ba0ae18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/worker/genericactuator/actuator_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ func (a *genericActuator) markAllMachinesForcefulDeletion(ctx context.Context, n
// TODO: Use github.com/gardener/gardener/pkg/utils/flow.Parallel as soon as we can vendor a new Gardener version again.
for _, machine := range existingMachines.Items {
wg.Add(1)
go func(machine *machinev1alpha1.Machine) {
go func(m machinev1alpha1.Machine) {
defer wg.Done()
if err := a.markMachineForcefulDeletion(ctx, machine); err != nil {
if err := a.markMachineForcefulDeletion(ctx, &m); err != nil {
errorList = append(errorList, err)
}
}(&machine)
}(machine)
}

wg.Wait()
Expand Down

0 comments on commit ba0ae18

Please sign in to comment.