-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
controllers: fix dynamic crd predicate #2911
controllers: fix dynamic crd predicate #2911
Conversation
/hold for testing. |
@rewantsoni ptal. |
for _, p := range e.predicates {
if !p.Create(c) {
return
}
} similar for other events can be found in same file. |
We have moved to EventTypePredicate in ocs-client op to make the predicate more generic, could we align? |
that doesn't solve the issue, possible to take a look at the description and mentioned EventTypePredicate solves it? |
c8765f5
to
c170dcf
Compare
/lgtm |
/unhold Loaned a cluster which already had provider-client setup and didn't test for virt sc creation but tested for restart when the crd state changes as follows
|
c170dcf
to
b030364
Compare
|
b030364
to
136bbf1
Compare
/jira backport release-4.18 |
@leelavg: The following backport issues have been created: Queuing cherrypicks to the requested branches to be created after this PR merges: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@openshift-ci-robot: once the present PR merges, I will cherry-pick it on top of In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/hold |
@leelavg we do not want to couple to predicate, each one should stay separate. The event predicate is a generic predicate to filter events based on event type. If the relationship between the predicates is wrong (and AND operation) let's fix that and not change the predicate themselves. Same goes for the order |
|
Maybe I am misunderstanding the problem or the change. I can see the move from the coupled predicate to the simpler decoupled predicate (name predicate and event type predicate) What I don't understand is the need for an Can you please describe your filtering logic in words first (maybe in the description), that will help in deciphering the change and reviewing the code |
Looking at the code again. You are using the tools the wrong way which complicates things. Your condition is logically 2 distinct conditions:
This boils down to filtering first on names, then filtering on event types:
|
|
No it doesn't, the queued event does not care
This is why we have the named filter to only trigger for named CRDs. Add to that the fact that you cannot get a DELETE event for a CR that does not exists from the start |
ba149f8
to
299f35f
Compare
if a single predicate reject the event then the runtime doesn't queue the reconcile for that controller and for dynamic crd feature multiple crds should be checked for event and at the same time presence of a single matching crd with corresponding predicate functions should initiate the reconcile. this commit uses helper function in predicate and creates the required logical conditions and refactor the crd predicate to directly take bools based on crd availability. Signed-off-by: Leela Venkaiah G <[email protected]>
Signed-off-by: Leela Venkaiah G <[email protected]>
|
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: leelavg, nb-ohad, rewantsoni The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
13988d9
into
red-hat-storage:main
@openshift-ci-robot: new pull request created: #2922 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
if a single predicate reject the event then the runtime doesn't queue the reconcile for that controller and for dynamic crd feature multiple crds should be checked for event and at the same time presence of a single matching crd with corresponding predicate functions should initiate the reconcile.
this commit uses helper function in predicate and creates the required logical conditions and refactor the crd predicate to directly take bools based on crd availability.