Skip to content

Commit b2c7960

Browse files
committed
fix: add warning log when users do not set annotation
1 parent 93a7148 commit b2c7960

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

docs/design/scheduling-gates-queue-admission.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,15 @@ func (alloc *Action) allocateResourcesForTasks(...) {
242242
243243
// Skip tasks with external (non-Volcano) scheduling gates
244244
if task.SchGated {
245-
// Tasks that contain the QueueAllocationGate have SchGated set to false by schedulingGateRemoval() above.
246-
klog.V(4).Infof("Task %s/%s has non-Volcano gate, skipping", task.Namespace, task.Name)
245+
if api.HasOnlyVolcanoSchedulingGate(task.Pod) {
246+
klog.Warningf("Task %s/%s has Volcano scheduling gate but missing annotation %q, gate will not be removed automatically; add the annotation or remove the gate manually",
247+
task.Namespace, task.Name, schedulingv1beta1.QueueAllocationGateKey)
248+
} else {
249+
klog.V(4).Infof("Task %s/%s has non-Volcano scheduling gate, skipping", task.Namespace, task.Name)
250+
}
247251
continue
248252
}
249253
250-
251254
// ... predicate checks ...
252255
// PrePredicate, node filtering, prioritization:
253256
// If any fail, pod is marked Unschedulable (gate was already queued for removal above)

pkg/scheduler/actions/allocate/allocate.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"k8s.io/klog/v2"
3131

3232
"volcano.sh/apis/pkg/apis/scheduling"
33+
schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
3334
"volcano.sh/volcano/cmd/scheduler/app/options"
3435
"volcano.sh/volcano/pkg/scheduler/api"
3536
"volcano.sh/volcano/pkg/scheduler/cache"
@@ -696,8 +697,12 @@ func (alloc *Action) allocateResourcesForTasks(subJob *api.SubJobInfo, tasks *ut
696697

697698
// Skip tasks with external (non-Volcano) scheduling gates
698699
if task.SchGated {
699-
// Tasks that contain the QueueAllocationGate have SchGated set to false by schedulingGateRemoval() above.
700-
klog.V(4).Infof("Task %s/%s has non-Volcano gate, skipping", task.Namespace, task.Name)
700+
if api.HasOnlyVolcanoSchedulingGate(task.Pod) {
701+
klog.Warningf("Task %s/%s has Volcano scheduling gate but missing annotation %q, gate will not be removed automatically; add the annotation or remove the gate manually",
702+
task.Namespace, task.Name, schedulingv1beta1.QueueAllocationGateKey)
703+
} else {
704+
klog.V(4).Infof("Task %s/%s has non-Volcano scheduling gate, skipping", task.Namespace, task.Name)
705+
}
701706
continue
702707
}
703708

0 commit comments

Comments
 (0)