-
Notifications
You must be signed in to change notification settings - Fork 68
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
feat: add Queue weight range [1-65535], default 1 #157
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: dongjiang <[email protected]>
[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 |
/assign @kevin-wangzefeng |
@@ -346,6 +346,9 @@ type NodeGroupAntiAffinity struct { | |||
// QueueSpec represents the template of Queue. | |||
type QueueSpec struct { | |||
// +optional | |||
// +kubebuilder:default:=1 |
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.
Setting default value:
https://github.com/volcano-sh/volcano/blob/master/pkg/cli/queue/create.go#L46
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.
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.
@@ -346,6 +346,9 @@ type NodeGroupAntiAffinity struct { | |||
// QueueSpec represents the template of Queue. | |||
type QueueSpec struct { | |||
// +optional | |||
// +kubebuilder:default:=1 | |||
// +kubebuilder:validation:Minimum=0 |
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.
The minimum value should be set to 1 instead of 0 to match the intended queue weight range of [1-65535].
// +kubebuilder:validation:Minimum=0 | |
// +kubebuilder:validation:Minimum=1 |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
fix Queue weight setting negative number, like
-2