Add support to recompute partial predicate metadata upon adding/removing pods

This commit is contained in:
Bobby (Babak) Salamat
2017-08-14 17:52:13 -07:00
parent acdf625e46
commit 264ca7d158
12 changed files with 592 additions and 81 deletions

View File

@@ -1590,7 +1590,7 @@ func TestServiceAffinity(t *testing.T) {
// Reimplementing the logic that the scheduler implements: Any time it makes a predicate, it registers any precomputations.
predicate, precompute := NewServiceAffinityPredicate(schedulertesting.FakePodLister(test.pods), schedulertesting.FakeServiceLister(test.services), FakeNodeListInfo(nodes), test.labels)
// Register a precomputation or Rewrite the precomputation to a no-op, depending on the state we want to test.
RegisterPredicatePrecomputation("checkServiceAffinity-unitTestPredicate", func(pm *predicateMetadata) {
RegisterPredicateMetadataProducer("ServiceAffinityMetaProducer", func(pm *predicateMetadata) {
if !skipPrecompute {
precompute(pm)
}