Skip to content

✨ Controller: Retain the priority #3167

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

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

alvaroaleman
Copy link
Member

@alvaroaleman alvaroaleman commented Mar 21, 2025

This change makes the controller retain the priority if a priority queue is used. The priority queue will still bump the priority if the item gets re-added to it with a higher priority.

Fixes #3157

/assign @sbueringer
/hold

This change makes the controller retain the priority if a priority queue
is used. The priority queue will still bump the priority if the item
gets re-added to it with a higher priority.
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 21, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 21, 2025
@@ -157,7 +158,12 @@ func (c *Controller[request]) Start(ctx context.Context) error {
// Set the internal context.
c.ctx = ctx

c.Queue = c.NewQueue(c.Name, c.RateLimiter)
queue := c.NewQueue(c.Name, c.RateLimiter)
if priorityQueue, isPriorityQueue := queue.(priorityqueue.PriorityQueue[request]); isPriorityQueue {
Copy link
Member Author

Choose a reason for hiding this comment

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

I found it easier to use a wrapper if we don't get a priority queue vs asserting the queue type everywhere where we access it

@sbueringer
Copy link
Member

Thx!

/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 21, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c453d8fd12275bdc0f3999ab27cff1508a75d14f

@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 2f2e7d8 into kubernetes-sigs:main Mar 21, 2025
16 checks passed
@alvaroaleman
Copy link
Member Author

/cherrypick release-0.20

@k8s-infra-cherrypick-robot

@alvaroaleman: new pull request created: #3173

In response to this:

/cherrypick release-0.20

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Controller should retain priority by default
4 participants