Skip to content

Commit

Permalink
Merge pull request kubernetes-retired#466 from k82cn/k8s_454
Browse files Browse the repository at this point in the history
Ordered Job by creation time.
  • Loading branch information
k8s-ci-robot authored Nov 7, 2018
2 parents d2754a9 + 4ab148f commit 6b1afdf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/scheduler/framework/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,12 @@ func (ssn *Session) JobOrderFn(l, r interface{}) bool {
lv := l.(*api.JobInfo)
rv := r.(*api.JobInfo)

return lv.UID < rv.UID
if lv.CreationTimestamp.Equal(&rv.CreationTimestamp) {
return lv.UID < rv.UID
}

return lv.CreationTimestamp.Before(&rv.CreationTimestamp)

}

func (ssn *Session) QueueOrderFn(l, r interface{}) bool {
Expand Down

0 comments on commit 6b1afdf

Please sign in to comment.