You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To my understanding, when creating a new controller with ctrl#Manager#NewControllerManagedBy and specifying that the controller owns a resource--e.g. Deployment--an object of said type only triggers the reconciliation loop, if its OwnerReferences field contains the id of the controller.
When using a predicate function to filter certain objects based on some logic--e.g. the object's namespace--the predicate is called before the objects owner reference is asserted. Let's take an example:
The predicate myFilter will be called on ALL Deployments regardless of the Deployment's owner reference, which might filter the request anyway since it may not have the controller set as its owner.
The text was updated successfully, but these errors were encountered:
I just realized that filtering objects based on some logic may only be a niche case of WithEventFilter. For the use-case of filtering requests based on the object's namespace, would it be more sensible to use Watches instead of Owns combined with an event filter?
For better or worse, the pipeline is source -> predicate -> handler. An argument can be made both for having predicate before and after handler, which is why we are not going to change it.
Using Watches and filtering in the Handler would allow you to do the filtering, based on the owner, yeah.
To my understanding, when creating a new controller with
ctrl#Manager#NewControllerManagedBy
and specifying that the controller owns a resource--e.g.Deployment
--an object of said type only triggers the reconciliation loop, if itsOwnerReferences
field contains the id of the controller.When using a predicate function to filter certain objects based on some logic--e.g. the object's namespace--the predicate is called before the objects owner reference is asserted. Let's take an example:
The predicate
myFilter
will be called on ALLDeployment
s regardless of theDeployment
's owner reference, which might filter the request anyway since it may not have the controller set as its owner.The text was updated successfully, but these errors were encountered: