Reconciler needs to provide a filter function for leader election
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 276
- Forks
- 344
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
Expected Behavior
Tekton has created a new custom resource called Run for running custom tasks. Each custom task implementer will provide a reconciler that watches for and processes Run objects that refer to its kind of custom task, through the use of the filter function given to the run informer.
Actual Behavior
We've found a case where a reconciler is given all Run objects, not just the ones it has requested through the filter function given to the run informer. This happens during leader election in this code:
A custom task implementer will not want to be given Run objects that it isn't written to handle. It needs to be able to pass a filter function to filter the objects on this path.
Steps to Reproduce the Problem
Any controller using leader election goes through this path. Run objects may be the first case though where there may be multiple independent controllers that are only interested in distinct subsets of the objects.
Additional Info
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 at pkg/client/injection/reconciler/pipeline/v1alpha1/run/controller.go around line 72 and trace the leader-election path and the filter function passed to the Run informer. Done means controllers using leader election preserve the requested filter so custom-task reconcilers receive only the Run objects they handle; verify against the reproduction described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100