diff --git a/pkg/scheduler/algorithm/scheduler_interface.go b/pkg/scheduler/algorithm/scheduler_interface.go index ffa275d45f..d74af089d3 100644 --- a/pkg/scheduler/algorithm/scheduler_interface.go +++ b/pkg/scheduler/algorithm/scheduler_interface.go @@ -26,6 +26,9 @@ import ( // decisions made by Kubernetes. This is typically needed for resources not directly // managed by Kubernetes. type SchedulerExtender interface { + // Name returns a unique name that identifies the extender. + Name() string + // Filter based on extender-implemented predicate functions. The filtered list is // expected to be a subset of the supplied list. failedNodesMap optionally contains // the list of failed nodes and failure reasons. diff --git a/pkg/scheduler/core/extender.go b/pkg/scheduler/core/extender.go index 6235f33074..9053a2e4ea 100644 --- a/pkg/scheduler/core/extender.go +++ b/pkg/scheduler/core/extender.go @@ -107,6 +107,11 @@ func NewHTTPExtender(config *schedulerapi.ExtenderConfig) (algorithm.SchedulerEx }, nil } +// Name returns extenderURL to identifies the extender. +func (h *HTTPExtender) Name() string { + return h.extenderURL +} + // IsIgnorable returns true indicates scheduling should not fail when this extender // is unavailable func (h *HTTPExtender) IsIgnorable() bool { diff --git a/pkg/scheduler/core/extender_test.go b/pkg/scheduler/core/extender_test.go index c2b93eafe5..e71f8805d6 100644 --- a/pkg/scheduler/core/extender_test.go +++ b/pkg/scheduler/core/extender_test.go @@ -120,6 +120,10 @@ type FakeExtender struct { cachedNodeNameToInfo map[string]*schedulercache.NodeInfo } +func (f *FakeExtender) Name() string { + return "FakeExtender" +} + func (f *FakeExtender) IsIgnorable() bool { return f.ignorable } diff --git a/pkg/scheduler/core/generic_scheduler.go b/pkg/scheduler/core/generic_scheduler.go index 11802b9200..feed37bb86 100644 --- a/pkg/scheduler/core/generic_scheduler.go +++ b/pkg/scheduler/core/generic_scheduler.go @@ -692,7 +692,7 @@ func PrioritizeNodes( } if glog.V(10) { for _, hostPriority := range results[index] { - glog.Infof("%v -> %v: %v, Score: (%d)", pod.Name, hostPriority.Host, config.Name, hostPriority.Score) + glog.Infof("%v -> %v: %v, Score: (%d)", util.GetPodFullName(pod), hostPriority.Host, config.Name, hostPriority.Score) } } }(i, priorityConfig) @@ -730,6 +730,9 @@ func PrioritizeNodes( mu.Lock() for i := range *prioritizedList { host, score := (*prioritizedList)[i].Host, (*prioritizedList)[i].Score + if glog.V(10) { + glog.Infof("%v -> %v: %v, Score: (%d)", util.GetPodFullName(pod), host, ext.Name(), score) + } combinedScores[host] += score * weight } mu.Unlock() diff --git a/pkg/scheduler/factory/factory_test.go b/pkg/scheduler/factory/factory_test.go index 2e7d4256e7..0b6fea9b9a 100644 --- a/pkg/scheduler/factory/factory_test.go +++ b/pkg/scheduler/factory/factory_test.go @@ -532,6 +532,10 @@ type fakeExtender struct { ignorable bool } +func (f *fakeExtender) Name() string { + return "fakeExtender" +} + func (f *fakeExtender) IsIgnorable() bool { return f.ignorable }