Skip to content

Reconciler needs to provide a filter function for leader election #1891

Open

Description

@GregDritschler

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

Activity

  1. GregDritschler commented on Nov 3, 2020

    @GregDritschler
    Author
  2. n3wscott commented on Nov 3, 2020

    @n3wscott
    Contributor

    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.

  3. github-actions commented on Feb 2, 2021

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

  4. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Feb 2, 2021
  5. slinkydeveloper commented on Feb 2, 2021

    @slinkydeveloper
    Contributor

    /remove-lifecycle-stale

    Hitting this issue while developing a secrets reconciler

  6. slinkydeveloper commented on Feb 2, 2021

    @slinkydeveloper
    Contributor

    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

  7. removed
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Feb 3, 2021
  8. github-actions commented on May 5, 2021

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

  9. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on May 5, 2021
  10. slinkydeveloper commented on May 5, 2021

    @slinkydeveloper
    Contributor

    /remove-lifecycle stale

  11. removed
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on May 6, 2021
  12. github-actions commented on Aug 5, 2021

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

  13. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Aug 5, 2021
  14. dprotaso commented on Sep 17, 2021

    @dprotaso
    Member

    /reopen
    /lifecycle frozen

  15. added
    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.
    and removed
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions