pkg icon indicating copy to clipboard operation
pkg copied to clipboard

Reconciler needs to provide a filter function for leader election

Open GregDritschler opened this issue 4 years ago • 9 comments

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:

https://github.com/tektoncd/pipeline/blob/master/pkg/client/injection/reconciler/pipeline/v1alpha1/run/controller.go#L72

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

GregDritschler avatar Nov 03 '20 16:11 GregDritschler

@n3wscott fyi

GregDritschler avatar Nov 03 '20 16:11 GregDritschler

Thanks for the bug report, I think we can fix this quick, but it will need to be in a few days because of the current release.

n3wscott avatar Nov 03 '20 16:11 n3wscott

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[bot] avatar Feb 02 '21 01:02 github-actions[bot]

/remove-lifecycle-stale

Hitting this issue while developing a secrets reconciler

slinkydeveloper avatar Feb 02 '21 09:02 slinkydeveloper

My controller loops indefinitely trying to reconcile every secret in the cluster, although I've set the following filters: https://github.com/slinkydeveloper/control-data-plane-communication/pull/11/files#diff-758961aac53d57d417fc85fa07093ab347dbd01929ebfc54ffe0cf2af64675b6R77

slinkydeveloper avatar Feb 02 '21 10:02 slinkydeveloper

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[bot] avatar May 05 '21 02:05 github-actions[bot]

/remove-lifecycle stale

slinkydeveloper avatar May 05 '21 07:05 slinkydeveloper

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[bot] avatar Aug 05 '21 01:08 github-actions[bot]

/reopen /lifecycle frozen

dprotaso avatar Sep 17 '21 00:09 dprotaso