Skip to content

Commit d9b9202

Browse files
committed
Switch back to wait.Group to keep module's Go version requirement
1 parent 334aa1f commit d9b9202

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/controller/sharder/reconciler.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package sharder
1919
import (
2020
"context"
2121
"fmt"
22-
"sync"
2322
"time"
2423

2524
"github.com/go-logr/logr"
@@ -31,6 +30,7 @@ import (
3130
"k8s.io/apimachinery/pkg/runtime/schema"
3231
"k8s.io/apimachinery/pkg/types"
3332
"k8s.io/apimachinery/pkg/util/sets"
33+
"k8s.io/apimachinery/pkg/util/wait"
3434
"k8s.io/utils/clock"
3535
"sigs.k8s.io/controller-runtime/pkg/client"
3636
logf "sigs.k8s.io/controller-runtime/pkg/log"
@@ -170,21 +170,21 @@ type workItem struct {
170170

171171
func (o *Operation) ResyncControllerRing(ctx context.Context, log logr.Logger) error {
172172
var (
173-
wg sync.WaitGroup
173+
wg wait.Group
174174
errs = make(chan error)
175175
work = make(chan *workItem, o.Concurrency)
176176
)
177177

178178
// Compile all objects that need to be moved or drained, and add them to the queue.
179179
// The buffer limit of the queue applies backpressure on the work generator (throttling list paging as needed).
180-
wg.Go(func() {
180+
wg.Start(func() {
181181
o.compileWorkItemsForRing(ctx, work, errs)
182182
close(work)
183183
})
184184

185185
// read work items from the queue and perform drains/movements with the configured concurrency
186186
for i := 0; i < o.Concurrency; i++ {
187-
wg.Go(func() {
187+
wg.Start(func() {
188188
for o.processNextWorkItem(ctx, log, work, errs) {
189189
}
190190
})

0 commit comments

Comments
 (0)