Skip to content

Commit 23975ef

Browse files
leona.houleona.hou
authored andcommitted
Set root capability only when user not set it
Signed-off-by: leona.hou <[email protected]>
1 parent 3aa260c commit 23975ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/scheduler/plugins/capacity/capacity.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,9 @@ func (cp *capacityPlugin) buildHierarchicalQueueAttrs(ssn *framework.Session) bo
598598

599599
// init root queue realCapability/capability/deserved as cp.totalResource
600600
rootQueueAttr := cp.queueOpts[api.QueueID(cp.rootQueue)]
601-
rootQueueAttr.capability = cp.totalResource
601+
if rootQueueAttr.capability == nil || rootQueueAttr.capability.IsEmpty() {
602+
rootQueueAttr.capability = cp.totalResource
603+
}
602604
rootQueueAttr.realCapability = cp.totalResource
603605
rootQueueAttr.deserved = cp.totalResource
604606
// Check the hierarchical structure of queues

0 commit comments

Comments
 (0)