Skip to content

Commit 8aadfc7

Browse files
committed
pass reference of sub to goroutine
Signed-off-by: Anik Bhattacharjee <anikbhattacharya93@gmail.com>
1 parent bdb7644 commit 8aadfc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/controller/operators/catalog/operator.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ func (o *Operator) updateSubscriptionStatuses(subs []*v1alpha1.Subscription) ([]
12661266

12671267
for _, sub := range subs {
12681268
wg.Add(1)
1269-
go func(sub v1alpha1.Subscription) {
1269+
go func(sub *v1alpha1.Subscription) {
12701270
defer wg.Done()
12711271

12721272
update := func() error {
@@ -1276,7 +1276,7 @@ func (o *Operator) updateSubscriptionStatuses(subs []*v1alpha1.Subscription) ([]
12761276
return err
12771277
}
12781278
latest.Status = sub.Status
1279-
sub = *latest
1279+
sub = latest
12801280
_, err = o.client.OperatorsV1alpha1().Subscriptions(sub.Namespace).UpdateStatus(context.TODO(), latest, updateOpts)
12811281
return err
12821282
}
@@ -1285,7 +1285,7 @@ func (o *Operator) updateSubscriptionStatuses(subs []*v1alpha1.Subscription) ([]
12851285
defer mu.Unlock()
12861286
errs = append(errs, err)
12871287
}
1288-
}(*sub)
1288+
}(sub)
12891289
}
12901290
wg.Wait()
12911291
return subs, utilerrors.NewAggregate(errs)

0 commit comments

Comments
 (0)