GC doesn't have to create monitors in the constructor

This commit is contained in:
Lukasz Szaszkiewicz
2020-06-05 12:18:53 +02:00
parent b6bdd64b10
commit 50db32cf8c
5 changed files with 5 additions and 22 deletions

View File

@@ -76,7 +76,6 @@ type GarbageCollector struct {
func NewGarbageCollector(
metadataClient metadata.Interface,
mapper resettableRESTMapper,
deletableResources map[schema.GroupVersionResource]struct{},
ignoredResources map[schema.GroupResource]struct{},
sharedInformers controller.InformerFactory,
informersStarted <-chan struct{},
@@ -91,7 +90,7 @@ func NewGarbageCollector(
attemptToOrphan: attemptToOrphan,
absentOwnerCache: absentOwnerCache,
}
gb := &GraphBuilder{
gc.dependencyGraphBuilder = &GraphBuilder{
metadataClient: metadataClient,
informersStarted: informersStarted,
restMapper: mapper,
@@ -105,10 +104,6 @@ func NewGarbageCollector(
sharedInformers: sharedInformers,
ignoredResources: ignoredResources,
}
if err := gb.syncMonitors(deletableResources); err != nil {
utilruntime.HandleError(fmt.Errorf("failed to sync all monitors: %v", err))
}
gc.dependencyGraphBuilder = gb
return gc, nil
}