Skip to content

[release-0.20] 🌱 Handlers: Default to LowPriorityWhenUnchanged without a wrapper #3179

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 6 commits into from
Mar 24, 2025

Conversation

alvaroaleman
Copy link
Member

This PR cherry-picks all the changes related to #3105 onto release-0.20

/assign @sbueringer

troy0820 and others added 6 commits March 24, 2025 10:40
…e interface (kubernetes-sigs#3111)

* implement priority queue for handlers

Signed-off-by: Troy Connor <troy0820@users.noreply.github.com>

* check object before placing in priorityqueue

Signed-off-by: Troy Connor <troy0820@users.noreply.github.com>

* implement priority queue

Signed-off-by: Troy Connor <troy0820@users.noreply.github.com>

---------

Signed-off-by: Troy Connor <troy0820@users.noreply.github.com>
This change makes the `TypedFuncs` and `enqueueRequestsFromMapFunc` set
a low priority when the object is unchanged by default, as well as
extend the test coverage to validate this behavior for `EnqueueRequestForOwner`.
The handlers themselves already support this, so there is no need to
also do it in the builder.
Signed-off-by: Stefan Büringer buringerst@vmware.com
We already did this for RequestForOwner, but not the typed variation,
this change adds that.
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 24, 2025
@sbueringer sbueringer added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 24, 2025
e.mapAndEnqueue(ctx, q, evt.Object, reqs)

var lowPriority bool
if e.objectImplementsClientObject && isPriorityQueue(q) && !isNil(evt.Object) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to also cherry-pick: #3162

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take that back. That would introduce too many changes

@sbueringer
Copy link
Member

Thank you!

/lgtm
/approve
/hold cancel

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Mar 24, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9158825b3f0e9ff576c6a1c57232a98bd033c60c

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, sbueringer

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:
  • OWNERS [alvaroaleman,sbueringer]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 0f7927c into kubernetes-sigs:release-0.20 Mar 24, 2025
10 checks passed
@alvaroaleman alvaroaleman deleted the lowpdefault branch March 26, 2025 14:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants