Wire contexts to Core controllers
This commit is contained in:
@@ -258,9 +258,9 @@ func setupWithServer(t *testing.T, result *kubeapiservertesting.TestServer, work
|
||||
t.Fatalf("failed to create garbage collector: %v", err)
|
||||
}
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
tearDown := func() {
|
||||
close(stopCh)
|
||||
cancel()
|
||||
result.TearDownFn()
|
||||
}
|
||||
syncPeriod := 5 * time.Second
|
||||
@@ -270,9 +270,9 @@ func setupWithServer(t *testing.T, result *kubeapiservertesting.TestServer, work
|
||||
// client. This is a leaky abstraction and assumes behavior about the REST
|
||||
// mapper, but we'll deal with it for now.
|
||||
restMapper.Reset()
|
||||
}, syncPeriod, stopCh)
|
||||
go gc.Run(workers, stopCh)
|
||||
go gc.Sync(clientSet.Discovery(), syncPeriod, stopCh)
|
||||
}, syncPeriod, ctx.Done())
|
||||
go gc.Run(ctx, workers)
|
||||
go gc.Sync(clientSet.Discovery(), syncPeriod, ctx.Done())
|
||||
}
|
||||
|
||||
if workerCount > 0 {
|
||||
|
Reference in New Issue
Block a user