Skip to content

Commit 35e4dee

Browse files
committed
Changed SetPodGroup to overwrite default subgroup minAvailable
1 parent 6a3b71d commit 35e4dee

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

pkg/scheduler/api/podgroup_info/job_info.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,14 @@ func (pgi *PodGroupInfo) SetPodGroup(pg *enginev2alpha2.PodGroup) {
171171
pgi.PodGroup = pg
172172
pgi.PodGroupUID = pg.UID
173173

174-
if len(pg.Spec.SubGroups) == 0 {
175-
if pgi.SubGroups == nil {
176-
pgi.SubGroups = map[string]*SubGroupInfo{}
177-
}
178-
if _, exists := pgi.SubGroups[DefaultSubGroup]; !exists {
179-
pgi.SubGroups[DefaultSubGroup] = NewSubGroupInfo(DefaultSubGroup, max(pg.Spec.MinMember, 1))
180-
}
181-
} else {
182-
pgi.SubGroups = map[string]*SubGroupInfo{}
174+
pgi.SubGroups = map[string]*SubGroupInfo{}
175+
if len(pg.Spec.SubGroups) > 0 {
183176
for _, sg := range pg.Spec.SubGroups {
184177
subGroupInfo := FromSubGroup(&sg)
185178
pgi.SubGroups[subGroupInfo.name] = subGroupInfo
186179
}
180+
} else {
181+
pgi.SubGroups[DefaultSubGroup] = NewSubGroupInfo(DefaultSubGroup, max(pg.Spec.MinMember, 1))
187182
}
188183

189184
if pg.Annotations[commonconstants.StalePodgroupTimeStamp] != "" {

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)