Add unit test TestGarbageCollectorSync

This commit is contained in:
jennybuckley
2018-03-16 11:28:58 -07:00
parent 02611149c1
commit 68e2a96016
3 changed files with 143 additions and 11 deletions

View File

@@ -166,7 +166,7 @@ type resettableRESTMapper interface {
// Note that discoveryClient should NOT be shared with gc.restMapper, otherwise
// the mapper's underlying discovery client will be unnecessarily reset during
// the course of detecting new resources.
func (gc *GarbageCollector) Sync(discoveryClient discovery.DiscoveryInterface, period time.Duration, stopCh <-chan struct{}) {
func (gc *GarbageCollector) Sync(discoveryClient discovery.ServerResourcesInterface, period time.Duration, stopCh <-chan struct{}) {
oldResources := make(map[schema.GroupVersionResource]struct{})
wait.Until(func() {
// Get the current resource list from discovery.