Skip to content

feat: add Queue weight range [1-65535], default 1 #157

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
Apr 23, 2025

Conversation

dongjiang1989
Copy link
Member

@dongjiang1989 dongjiang1989 commented Mar 6, 2025

fix Queue weight setting negative number, like -2

@dongjiang1989
Copy link
Member Author

/assign @kevin-wangzefeng

@@ -346,6 +346,9 @@ type NodeGroupAntiAffinity struct {
// QueueSpec represents the template of Queue.
type QueueSpec struct {
// +optional
// +kubebuilder:default:=1
Copy link
Member Author

@dongjiang1989 dongjiang1989 Mar 6, 2025

Choose a reason for hiding this comment

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

Setting default value:
https://github.com/volcano-sh/volcano/blob/master/pkg/cli/queue/create.go#L46

and Default Queue weight is 1

@Monokaix Monokaix requested a review from Copilot March 7, 2025 07:44
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR implements validation for the Queue weight by adding kubebuilder annotations, enforcing the intended weight range and default value.

  • Adds a default value of 1 for the Queue weight
  • Implements validation annotations to restrict the Queue weight value

Reviewed Changes

File Description
pkg/apis/scheduling/v1beta1/types.go Added kubebuilder annotations to the QueueSpec.Weight field to enforce a default and a value range

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Signed-off-by: dongjiang <[email protected]>
Co-Authored-By: Copilot <[email protected]>
@Monokaix
Copy link
Member

/lgtm

Copy link
Member

@kevin-wangzefeng kevin-wangzefeng left a comment

Choose a reason for hiding this comment

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

/approve

@volcano-sh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kevin-wangzefeng

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

@volcano-sh-bot volcano-sh-bot merged commit cdfc2bd into volcano-sh:master Apr 23, 2025
2 checks passed
@dongjiang1989 dongjiang1989 deleted the add-weight-range branch April 24, 2025 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants