Skip to content

Commit

Permalink
Add endpointSlice informer in master process
Browse files Browse the repository at this point in the history
Signed-off-by: Zenghui Shi <zshi@redhat.com>
(cherry picked from commit b6c1b08)
  • Loading branch information
zshi-redhat committed Oct 11, 2022
1 parent 945ffe2 commit 55bb05b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions go-controller/pkg/factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ func NewMasterWatchFactory(ovnClientset *util.OVNClientset) (*WatchFactory, erro
noAlternateProxySelector())
})

wf.iFactory.InformerFor(&discovery.EndpointSlice{}, func(c kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return discoveryinformers.NewFilteredEndpointSliceInformer(
c,
kapi.NamespaceAll,
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
withServiceNameAndNoHeadlessServiceSelector())
})

var err error
// Create our informer-wrapper informer (and underlying shared informer) for types we need
wf.informers[PodType], err = newQueuedInformer(PodType, wf.iFactory.Core().V1().Pods().Informer(), wf.stopChan,
Expand All @@ -177,6 +186,10 @@ func NewMasterWatchFactory(ovnClientset *util.OVNClientset) (*WatchFactory, erro
if err != nil {
return nil, err
}
wf.informers[EndpointSliceType], err = newInformer(EndpointSliceType, wf.iFactory.Discovery().V1().EndpointSlices().Informer())
if err != nil {
return nil, err
}
if config.OVNKubernetesFeature.EnableEgressIP {
wf.informers[EgressIPType], err = newInformer(EgressIPType, wf.eipFactory.K8s().V1().EgressIPs().Informer())
if err != nil {
Expand Down

0 comments on commit 55bb05b

Please sign in to comment.