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 3ef031e + 1ec8b04 commit e92ee44
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 e92ee44

Please sign in to comment.