pkg
pkg copied to clipboard
FilterFunc in the informer is not working on the first run of reconciler
/kind bug
Expected Behavior
The informer should always successfully filter objects based on filterFunc defined the informer
Actual Behavior
In the first run of the reconcile, it lists all objects and objects are not filtered by filterFunc in the informer
Steps to Reproduce the Problem
- Given a controller with an informer that has a filterFunc
- Deploy the controller
- In the first run of the reconciler, it reconciles all the objects but not only the objects should pass the filterFunc
Additional Info
We did some investigation, in the genreconciler: https://github.com/google/knative-gcp/blob/3707bd3ca3d010532b334201dc7da6c9bc382959/pkg/client/injection/reconciler/broker/v1beta1/broker/controller.go#L73-L81 When a controller starts, a new leader is promoted with a listAll operation and there is no informer resync.
@mattmoor @n3wscott @grantr
Yup, there's no filter passed to genreconciler currently, but you could plumb one through in the controller options.
@mattmoor can you point to an example of plumbing through? Looks like the code directly enqueues every object in the lister, skipping any informer FilterFunc.
By "plumbing through" I mean adding a field and calling it from that logic in genreconciler itself, there is no field today.
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
/lifecycle frozen