Use scheduler cache in affinity priority functions

Make the cache implement NodeLister and expose it to the priority
functions. This way, the priority functions make use of a single cache,
the scheduler's, instead of mixing it with the lister's caches.

Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
Aldo Culquicondor
2019-07-16 10:51:39 -04:00
parent ac2c1ce08a
commit f58abdf966
9 changed files with 53 additions and 54 deletions

View File

@@ -33,9 +33,9 @@ var _ algorithm.NodeLister = &FakeNodeLister{}
// FakeNodeLister implements NodeLister on a []string for test purposes.
type FakeNodeLister []*v1.Node
// List returns nodes as a []string.
func (f FakeNodeLister) List() ([]*v1.Node, error) {
return f, nil
// ListNodes returns nodes as a []*v1.Node.
func (f FakeNodeLister) ListNodes() []*v1.Node {
return f
}
var _ algorithm.PodLister = &FakePodLister{}