Add explain for preempt sunction.

This commit is contained in:
Stewart-YU 2017-10-30 16:23:42 +08:00 committed by stewart-yu
parent e5c732ee93
commit bc2845ee08

View File

@ -184,6 +184,9 @@ func (sched *Scheduler) schedule(pod *v1.Pod) (string, error) {
return host, err
}
// preempt tries to create room for a pod that has failed to schedule, by preempting lower priority pods if possible.
// If it succeeds, it adds the name of the node where preemption has happened to the pod annotations.
// It returns the node name and an error if any.
func (sched *Scheduler) preempt(preemptor *v1.Pod, scheduleErr error) (string, error) {
if !utilfeature.DefaultFeatureGate.Enabled(features.PodPriority) {
glog.V(3).Infof("Pod priority feature is not enabled. No preemption is performed.")