Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FilterFunc in the informer is not working on the first run of reconciler #1764

Open
danyinggu opened this issue Oct 1, 2020 · 6 comments
Open
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@danyinggu
Copy link

danyinggu commented Oct 1, 2020

/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

  1. Given a controller with an informer that has a filterFunc
  2. Deploy the controller
  3. 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.

@danyinggu
Copy link
Author

@mattmoor @n3wscott @grantr

@mattmoor
Copy link
Member

mattmoor commented Oct 1, 2020

Yup, there's no filter passed to genreconciler currently, but you could plumb one through in the controller options.

@grantr
Copy link
Contributor

grantr commented Oct 1, 2020

@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.

@mattmoor
Copy link
Member

mattmoor commented Oct 1, 2020

By "plumbing through" I mean adding a field and calling it from that logic in genreconciler itself, there is no field today.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 31, 2020
@mattmoor
Copy link
Member

mattmoor commented Jan 4, 2021

/lifecycle frozen

@knative-prow-robot knative-prow-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

4 participants