Merge pull request #754 from red-firefly/fix/pod-group-queue
[controller] Set `Queue` field when pod has queue name annotation
This commit is contained in:
commit
cc110278d5
|
|
@ -22,4 +22,8 @@ const KubeGroupNameAnnotationKey = "scheduling.k8s.io/group-name"
|
|||
|
||||
// VolcanoGroupNameAnnotationKey is the annotation key of Pod to identify
|
||||
// which PodGroup it belongs to.
|
||||
const VolcanoGroupNameAnnotationKey = "scheduling.volcano.sh/group-name"
|
||||
const VolcanoGroupNameAnnotationKey = GroupName + "/group-name"
|
||||
|
||||
// QueueNameAnnotationKey is the annotation key of Pod to identify
|
||||
// which queue it belongs to.
|
||||
const QueueNameAnnotationKey = GroupName + "/queue-name"
|
||||
|
|
|
|||
|
|
@ -90,6 +90,9 @@ func (cc *Controller) createNormalPodPGIfNotExist(pod *v1.Pod) error {
|
|||
PriorityClassName: pod.Spec.PriorityClassName,
|
||||
},
|
||||
}
|
||||
if queueName, ok := pod.Annotations[scheduling.QueueNameAnnotationKey]; ok {
|
||||
pg.Spec.Queue = queueName
|
||||
}
|
||||
|
||||
if _, err := cc.vcClient.SchedulingV1beta1().PodGroups(pod.Namespace).Create(pg); err != nil {
|
||||
klog.Errorf("Failed to create normal PodGroup for Pod <%s/%s>: %v",
|
||||
|
|
|
|||
Loading…
Reference in New Issue