Move VolumeZone predicate to its Filter plugin

Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
This commit is contained in:
zouyee
2019-12-26 21:36:11 +08:00
parent 04d71d8a7b
commit c4331b0369
6 changed files with 134 additions and 503 deletions

View File

@@ -156,7 +156,9 @@ func TestSingleZone(t *testing.T) {
node := &schedulernodeinfo.NodeInfo{}
node.SetNode(test.Node)
p := &VolumeZone{
predicate: predicates.NewVolumeZonePredicate(pvLister, pvcLister, nil),
pvLister,
pvcLister,
nil,
}
gotStatus := p.Filter(context.Background(), nil, test.Pod, node)
if !reflect.DeepEqual(gotStatus, test.wantStatus) {
@@ -241,7 +243,9 @@ func TestMultiZone(t *testing.T) {
node := &schedulernodeinfo.NodeInfo{}
node.SetNode(test.Node)
p := &VolumeZone{
predicate: predicates.NewVolumeZonePredicate(pvLister, pvcLister, nil),
pvLister,
pvcLister,
nil,
}
gotStatus := p.Filter(context.Background(), nil, test.Pod, node)
if !reflect.DeepEqual(gotStatus, test.wantStatus) {
@@ -348,7 +352,9 @@ func TestWithBinding(t *testing.T) {
node := &schedulernodeinfo.NodeInfo{}
node.SetNode(test.Node)
p := &VolumeZone{
predicate: predicates.NewVolumeZonePredicate(pvLister, pvcLister, scLister),
pvLister,
pvcLister,
scLister,
}
gotStatus := p.Filter(context.Background(), nil, test.Pod, node)
if !reflect.DeepEqual(gotStatus, test.wantStatus) {