FilterFunc in the informer is not working on the first run of reconciler
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 276
- Forks
- 344
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
/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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked pkg/client/injection/reconciler/broker/v1beta1/broker/controller.go lines 73-81 and trace the informer startup and first reconcile path. Reproduce a controller with a filterFunc, then verify that the initial reconcile processes only objects accepted by the filter rather than all listed objects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100