Commit ea16e52f authored by Yu-Ju Hong's avatar Yu-Ju Hong

Merge pull request #10642 from davidopp/clean

Clarify and make less verbose event message for infeasible pods.
parents 1817f746 950ab8f2
......@@ -41,12 +41,15 @@ var ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods")
// implementation of the error interface
func (f *FitError) Error() string {
predicates := util.NewStringSet()
var reason string
// We iterate over all nodes for logging purposes, even though we only return one reason from one node
for node, predicateList := range f.FailedPredicates {
predicates = predicates.Union(predicateList)
glog.Infof("failed to find fit for pod %v on node %s: %s", f.Pod.Name, node, strings.Join(predicateList.List(), ","))
if len(reason) == 0 {
reason, _ = predicateList.PopAny()
}
}
return fmt.Sprintf("For each of these fitness predicates, pod %v failed on at least one node: %v.", f.Pod.Name, strings.Join(predicates.List(), ","))
return fmt.Sprintf("Failed for reason %s and possibly others", reason)
}
type genericScheduler struct {
......
......@@ -125,7 +125,7 @@ func (s *Scheduler) scheduleOne() {
metrics.SchedulingAlgorithmLatency.Observe(metrics.SinceInMicroseconds(start))
if err != nil {
glog.V(1).Infof("Failed to schedule: %v", pod)
s.config.Recorder.Eventf(pod, "failedScheduling", "Error scheduling: %v", err)
s.config.Recorder.Eventf(pod, "failedScheduling", "%v", err)
s.config.Error(pod, err)
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment