update GC controller to wait until controllers have been initialized once

This commit is contained in:
David Eads
2017-08-24 12:39:55 -04:00
parent 4a6bbb9f50
commit 253b047d89
6 changed files with 30 additions and 3 deletions

View File

@@ -242,6 +242,8 @@ func setup(t *testing.T, workerCount int) *testContext {
metaOnlyClientPool := dynamic.NewClientPool(&config, restMapper, dynamic.LegacyAPIPathResolverFunc)
clientPool := dynamic.NewClientPool(&config, restMapper, dynamic.LegacyAPIPathResolverFunc)
sharedInformers := informers.NewSharedInformerFactory(clientSet, 0)
alwaysStarted := make(chan struct{})
close(alwaysStarted)
gc, err := garbagecollector.NewGarbageCollector(
metaOnlyClientPool,
clientPool,
@@ -249,6 +251,7 @@ func setup(t *testing.T, workerCount int) *testContext {
deletableResources,
garbagecollector.DefaultIgnoredResources(),
sharedInformers,
alwaysStarted,
)
if err != nil {
t.Fatalf("failed to create garbage collector: %v", err)