Tolerate partial discovery in garbage collector

Allow the garbage collector to tolerate partial discovery failures. On a
partial failure, use whatever was discovered, log the failures, and
allow the resync logic to try again later.

Fixes #55022.
This commit is contained in:
Dan Mace
2017-11-07 13:19:43 -05:00
parent 45bdf707f0
commit c3dd82c30c
5 changed files with 140 additions and 19 deletions

View File

@@ -233,10 +233,7 @@ func setup(t *testing.T, workerCount int) *testContext {
discoveryClient := cacheddiscovery.NewMemCacheClient(clientSet.Discovery())
restMapper := discovery.NewDeferredDiscoveryRESTMapper(discoveryClient, meta.InterfacesForUnstructured)
restMapper.Reset()
deletableResources, err := garbagecollector.GetDeletableResources(discoveryClient)
if err != nil {
t.Fatalf("unable to get deletable resources: %v", err)
}
deletableResources := garbagecollector.GetDeletableResources(discoveryClient)
config := *masterConfig
config.ContentConfig = dynamic.ContentConfig()
metaOnlyClientPool := dynamic.NewClientPool(&config, restMapper, dynamic.LegacyAPIPathResolverFunc)