-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[bugfix]fix creating a hierarchical sub-queue will be rejected #4033
base: master
Are you sure you want to change the base?
[bugfix]fix creating a hierarchical sub-queue will be rejected #4033
Conversation
Welcome @zhutong196! |
[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 @k82cn @william-wang cc |
/milestone v1.12 |
Should also backport to release-1.11 after meged. |
if allocated, ok := parentQueue.Status.Allocated[v1.ResourcePods]; ok && !allocated.IsZero() { | ||
return fmt.Errorf("queue %s cannot be the parent queue of queue %s because it has allocated Pods: %d", | ||
parentQueue.Name, queue.Name, allocated.Value()) | ||
queueList, err := config.QueueLister.List(labels.Everything()) |
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.
These are duplicated logic with validateQueueDeleting
, we can abstract a func.
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.
Good suggestion, I will abstract a func of whether there is a child in the repeated judgments of validateQueueDeleting
and validateHierarchicalQueue
into a method
Please also add UT and sign off your commit. |
Signed-off-by: zhutongtong <[email protected]>
please use |
What type of PR is this?
Add one of the following kinds:
/kind bug
Optionally add one of the following areas, help us further classify and filter PRs:
/area webhooks
What this PR does / why we need it:
check whether a queue is a leaf queue. Only leaf queue without pods inside can create sub-queues, there is no check of non-leaf queues.
Which issue(s) this PR fixes:
Fixes # #4031
Special notes for your reviewer:
Does this PR introduce a user-facing change?
NONE