Wire contexts to Core controllers

This commit is contained in:
Mike Dame
2021-04-22 14:27:59 -04:00
parent 657412713b
commit 4960d0976a
61 changed files with 842 additions and 780 deletions

View File

@@ -141,10 +141,10 @@ func TestTTLAnnotations(t *testing.T) {
nodeInformer := informers.Core().V1().Nodes()
ttlc := ttl.NewTTLController(nodeInformer, testClient)
stopCh := make(chan struct{})
defer close(stopCh)
go nodeInformer.Informer().Run(stopCh)
go ttlc.Run(1, stopCh)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
go nodeInformer.Informer().Run(ctx.Done())
go ttlc.Run(ctx, 1)
// Create 100 nodes all should have annotation equal to 0.
createNodes(t, testClient, 0, 100)