support label volcano.sh/task-priority

Signed-off-by: bert.li <qiankun.li@qq.com>
This commit is contained in:
bert.li 2021-12-08 11:27:39 +08:00
parent f29da613f6
commit 3cd2108ff4
1 changed files with 5 additions and 0 deletions

View File

@ -162,6 +162,11 @@ func NewTaskInfo(pod *v1.Pod) *TaskInfo {
},
}
if taskPriority, ok := pod.Labels["volcano.sh/task-priority"]; ok {
if priority, err := strconv.ParseInt(taskPriority, 10, 32); err == nil {
ti.Priority = int32(priority)
}
}
if pod.Spec.Priority != nil {
ti.Priority = *pod.Spec.Priority
}