Skip to content

Commit

Permalink
scheduler: resolve the wrong use of gangmod in gang init phase
Browse files Browse the repository at this point in the history
Signed-off-by: PeterChang <changyi@xiaomi.com>
  • Loading branch information
PeterChg committed Mar 4, 2024
1 parent 3390433 commit a0b58ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/scheduler/plugins/coscheduling/core/gang.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ func (gang *Gang) tryInitByPodConfig(pod *v1.Pod, args *config.CoschedulingArgs)
gang.Mode = mode

matchPolicy := util.GetGangMatchPolicyByPod(pod)
if matchPolicy != extension.GangMatchPolicyOnlyWaiting && mode != extension.GangMatchPolicyWaitingAndRunning &&
mode != extension.GangMatchPolicyOnceSatisfied {
if matchPolicy != extension.GangMatchPolicyOnlyWaiting && matchPolicy != extension.GangMatchPolicyWaitingAndRunning &&
matchPolicy != extension.GangMatchPolicyOnceSatisfied {
klog.Errorf("pod's annotation AnnotationGangMatchPolicy illegal, gangName: %v, value: %v",
gang.Name, matchPolicy)
matchPolicy = extension.GangMatchPolicyOnceSatisfied
Expand Down Expand Up @@ -205,9 +205,9 @@ func (gang *Gang) tryInitByPodGroup(pg *v1alpha1.PodGroup, args *config.Coschedu
gang.Mode = mode

matchPolicy := pg.Annotations[extension.AnnotationGangMatchPolicy]
if matchPolicy != extension.GangMatchPolicyOnlyWaiting && mode != extension.GangMatchPolicyWaitingAndRunning &&
mode != extension.GangMatchPolicyOnceSatisfied {
klog.Errorf("pod's annotation AnnotationGangMatchPolicy illegal, gangName: %v, value: %v",
if matchPolicy != extension.GangMatchPolicyOnlyWaiting && matchPolicy != extension.GangMatchPolicyWaitingAndRunning &&
matchPolicy != extension.GangMatchPolicyOnceSatisfied {
klog.Errorf("podGroup's annotation AnnotationGangMatchPolicy illegal, gangName: %v, value: %v",
gang.Name, matchPolicy)
matchPolicy = extension.GangMatchPolicyOnceSatisfied
}
Expand Down

0 comments on commit a0b58ed

Please sign in to comment.