Skip to content

Conversation

@alvaroaleman
Copy link
Member

Making the priority opt a pointer allows to dinstinguish "unset" from "0". While this is irrelevant for the priorityqueue itself, it is required for any wrapper that wants to inject a default priority without overriding one that was explicitly set.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@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. labels Aug 19, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 19, 2025
@alvaroaleman alvaroaleman changed the title :warn: Priorityqueue: Make priority opt a pointer ⚠️ Priorityqueue: Make priority opt a pointer Aug 19, 2025
Making the priority opt a pointer allows to dinstinguish "unset" from "0". While this is irrelevant for the priorityqueue itself, it is required for any wrapper that wants to inject a default priority without overriding one that was explicitly set.
}
q.(priorityqueue.PriorityQueue[request]).AddWithOpts(
priorityqueue.AddOpts{Priority: priority},
priorityqueue.AddOpts{Priority: &priority},
Copy link
Member

Choose a reason for hiding this comment

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

Should this only be set if IsInInitialList is true?

(currently we otherwise set it to &0)

(same below)


Expect(actualOpts).To(Equal(priorityqueue.AddOpts{}))
Expect(actualOpts).To(Or(
Equal(priorityqueue.AddOpts{}),
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if &0 is correct here

(similar below)

@sbueringer
Copy link
Member

I think my findings are addressed in #3290
So I'll merge this PR

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 19, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: ab67793043706cbe1cb2c8b235fb7f9bdc2b6d3d

@k8s-ci-robot k8s-ci-robot merged commit 542acae into kubernetes-sigs:main Aug 19, 2025
9 checks passed
@sbueringer sbueringer mentioned this pull request Oct 3, 2025
22 tasks
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

3 participants