diff --git a/k8s/clients.go b/k8s/clients.go index bdf37bbfedc483ca078aabd45be8b707260fcdc3..8b1390bd85f905eac54bf8ddbdf9ee0c117fa82f 100644 --- a/k8s/clients.go +++ b/k8s/clients.go @@ -3,6 +3,7 @@ package k8s import ( "context" "net/url" + "time" "go.acides.org/pekahi" core "k8s.io/api/core/v1" @@ -78,22 +79,17 @@ func newClientsForKC(kc *rest.Config) (*Clients, error) { return nil, err } cachedClient := memory.NewMemCacheClient(baseClient) - restMapper := restmapper.NewDeferredDiscoveryRESTMapper(cachedClient) - broadcaster := events.NewEventBroadcasterAdapter(eventsClient) - informers := informers.NewSharedInformerFactory(baseClient, 0) - metadataInformers := metadatainformer.NewSharedInformerFactory(metadataClient, 0) - dynInformers := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynClient, 0, core.NamespaceAll, nil) return &Clients{ KubeConfig: kc, Client: baseClient, DynClient: dynClient, EventClient: eventsClient, MetadataClient: metadataClient, - RESTMapper: restMapper, - Broadcaster: broadcaster, - Informer: informers, - MetadataInformer: metadataInformers, - DynInformer: dynInformers, + RESTMapper: restmapper.NewDeferredDiscoveryRESTMapper(cachedClient), + Broadcaster: events.NewEventBroadcasterAdapter(eventsClient), + Informer: informers.NewSharedInformerFactory(baseClient, 10*time.Minute), + MetadataInformer: metadatainformer.NewSharedInformerFactory(metadataClient, 10*time.Minute), + DynInformer: dynamicinformer.NewDynamicSharedInformerFactory(dynClient, 10*time.Minute), }, nil }