Move ServiceAntiAffinityPriority to score plugin

This commit is contained in:
danielqsj
2019-12-26 15:23:06 +08:00
parent 13133857af
commit f53c81f4a2
6 changed files with 110 additions and 347 deletions

View File

@@ -391,13 +391,13 @@ func TestServiceAffinityScore(t *testing.T) {
nodes := makeLabeledNodeList(test.nodes)
snapshot := nodeinfosnapshot.NewSnapshot(nodeinfosnapshot.CreateNodeInfoMap(test.pods, nodes))
serviceLister := fakelisters.ServiceLister(test.services)
priorityMapFunction, priorityReduceFunction := priorities.NewServiceAntiAffinityPriority(snapshot.Pods(), serviceLister, test.labels)
p := &ServiceAffinity{
sharedLister: snapshot,
serviceLister: serviceLister,
priorityMapFunction: priorityMapFunction,
priorityReduceFunction: priorityReduceFunction,
sharedLister: snapshot,
serviceLister: serviceLister,
args: Args{
AntiAffinityLabelsPreference: test.labels,
},
}
metaDataProducer := priorities.NewMetadataFactory(
fakelisters.ServiceLister(test.services),