Skip to content

Commit

Permalink
endpointaccessible: create an EndpointAccessibleController with optio…
Browse files Browse the repository at this point in the history
…nal filtered triggers and filter func
  • Loading branch information
liouk committed Oct 3, 2023
1 parent 4ccf34b commit 4d89757
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/libs/endpointaccessible/endpoint_accessible_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func NewEndpointAccessibleController(
endpointListFn EndpointListFunc,
getTLSConfigFn EndpointTLSConfigFunc,
triggers []factory.Informer,
filteredTriggers []factory.Informer, filterFunc factory.EventFilterFunc,
recorder events.Recorder,
resyncInterval time.Duration,
) factory.Controller {
Expand All @@ -48,13 +49,15 @@ func NewEndpointAccessibleController(
availableConditionName: name + "EndpointAccessibleControllerAvailable",
}

return factory.New().
factory := factory.New().
WithInformers(triggers...).
WithFilteredEventsInformers(filterFunc, filteredTriggers...).
WithInformers(operatorClient.Informer()).
WithSync(c.sync).
ResyncEvery(resyncInterval).
WithSyncDegradedOnError(operatorClient).
ToController(controllerName, recorder.WithComponentSuffix(name+"endpoint-accessible-controller"))
WithSyncDegradedOnError(operatorClient)

return factory.ToController(controllerName, recorder.WithComponentSuffix(name+"endpoint-accessible-controller"))
}

// humanizeError produce error message that makes more sense to humans/admins.
Expand Down

0 comments on commit 4d89757

Please sign in to comment.