Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dongjiang1989
Copy link
Contributor

@dongjiang1989 dongjiang1989 commented Mar 6, 2025

fix Queue weight setting negative number, like -2

@volcano-sh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign kevin-wangzefeng
You can assign the PR to them by writing /assign @kevin-wangzefeng in a comment when ready.

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

@dongjiang1989
Copy link
Contributor 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
Contributor Author

Choose a reason for hiding this comment

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

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

@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.

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

Copilot AI Mar 7, 2025

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].

Suggested change
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Minimum=1

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants