-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🐛 Use the watch filter label when watching resources #5358
Conversation
Hi @fiunchinho. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
fef1e44
to
b98cd3a
Compare
b98cd3a
to
7e6fd18
Compare
Watches( | ||
&source.Kind{Type: &clusterv1.Machine{}}, | ||
handler.EnqueueRequestsFromMapFunc(r.MachineToBootstrapMapFunc), | ||
) | ||
).WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add the same predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)
blow in the watch in line 121
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 121 contains
predicates.All(ctrl.LoggerFrom(ctx),
predicates.ClusterUnpausedAndInfrastructureReady(ctrl.LoggerFrom(ctx)),
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
)
so it should be already covered, shouldn't it?
/ok-to-test Thanks @fiunchinho, I dropped some cosmetic suggestions but this make sense to me. I'm curious about the use case why you need this? |
7e6fd18
to
9738a58
Compare
Thanks @fiunchinho! /lgtm |
/assign @fabriziopandini |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Should we apply this change to to controllers in controllers/topology too?
I think all controllers there already use the watch filter label. |
@fiunchinho thanks for checking controllers/topology /lgtm |
9738a58
to
101b405
Compare
/lgtm |
Let's get this merged and backported to 0.4? /cherrypick release-0.4 |
@vincepri: once the present PR merges, I will cherry-pick it on top of release-0.4 in a new PR and assign it to you. 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/test-infra repository. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
@vincepri: new pull request created: #5379 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/test-infra repository. |
What this PR does / why we need it:
Some of the reconcilers keep reconciling resources that don't have the watch filter label.