-
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
✨ Added filter function to controller reconciler #8016
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does the apidiff incompatible mean? How could I make the CI happy?
|
@@ -42,6 +43,9 @@ type KubeadmConfigReconciler struct { | |||
// WatchFilterValue is the label value used to filter events prior to reconciliation. | |||
WatchFilterValue string | |||
|
|||
// Filter checks if a KubeadmConfig object should be reconciled. | |||
Filter predicates.Filter |
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.
/hold
My personal opinion is that we should not add a new knob to filter what we reconcile which is orthogonal to WatchFilterValue and its possible improvements being discussed in #7775.
IMO those efforts should converge and come up with a common definition of what a filter is, that could translate into e.g. a watch filter struct or other solutions.
Also, worth to notice that such type of change in order to actually work should be accepted by provider implementers as well, and this requires a discussion during office hours or a small proposal to rally on async.
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.
I am ok with moving discussion to #7775.
@@ -160,6 +162,9 @@ func (r *KubeadmConfigReconciler) Reconcile(ctx context.Context, req ctrl.Reques | |||
log.Error(err, "Failed to get config") | |||
return ctrl.Result{}, err | |||
} | |||
if r.Filter != nil && !r.Filter.Filter(config) { |
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.
Filters should be applied before actually entering in the reconcile loop (e.g. in while setting up controllers)
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.
But then how can we filter out resources that are triggered by another kind of resource?
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
PR needs rebase. 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. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. 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:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #7949