Skip to content

Commit d96356d

Browse files
authored
Changed SetPodGroup to overwrite default subgroup minAvailable (#446)
* Changed SetPodGroup to overwrite default subgroup minAvailable * Update existing default subgroup minMember if already exists
1 parent 6a3b71d commit d96356d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/scheduler/api/podgroup_info/job_info.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,11 @@ func (pgi *PodGroupInfo) SetPodGroup(pg *enginev2alpha2.PodGroup) {
175175
if pgi.SubGroups == nil {
176176
pgi.SubGroups = map[string]*SubGroupInfo{}
177177
}
178-
if _, exists := pgi.SubGroups[DefaultSubGroup]; !exists {
178+
defaultSubGroup, found := pgi.SubGroups[DefaultSubGroup]
179+
if !found {
179180
pgi.SubGroups[DefaultSubGroup] = NewSubGroupInfo(DefaultSubGroup, max(pg.Spec.MinMember, 1))
181+
} else {
182+
defaultSubGroup.SetMinAvailable(max(pg.Spec.MinMember, 1))
180183
}
181184
} else {
182185
pgi.SubGroups = map[string]*SubGroupInfo{}

test/e2e/suites/api/events/events_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/NVIDIA/KAI-scheduler/test/e2e/modules/wait"
2323
)
2424

25-
var _ = Describe("Priority Preemption", Ordered, func() {
25+
var _ = Describe("Events", Ordered, func() {
2626
var (
2727
testCtx *testcontext.TestContext
2828
)

0 commit comments

Comments
 (0)