mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
Scheduler doesn't send all fit predicate failures as events
This commit is contained in:
parent
640c40da65
commit
4bb3efaaad
@ -27,6 +27,7 @@ import (
|
|||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/algorithm"
|
"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/algorithm"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/algorithm/predicates"
|
"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/algorithm/predicates"
|
||||||
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FailedPredicateMap map[string]util.StringSet
|
type FailedPredicateMap map[string]util.StringSet
|
||||||
@ -40,11 +41,12 @@ var ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods")
|
|||||||
|
|
||||||
// implementation of the error interface
|
// implementation of the error interface
|
||||||
func (f *FitError) Error() string {
|
func (f *FitError) Error() string {
|
||||||
output := fmt.Sprintf("failed to find fit for pod, ")
|
predicates := util.NewStringSet()
|
||||||
for node, predicateList := range f.FailedPredicates {
|
for node, predicateList := range f.FailedPredicates {
|
||||||
output = output + fmt.Sprintf("Node %s: %s", node, strings.Join(predicateList.List(), ","))
|
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(), ","))
|
||||||
}
|
}
|
||||||
return output
|
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(), ","))
|
||||||
}
|
}
|
||||||
|
|
||||||
type genericScheduler struct {
|
type genericScheduler struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user