Eliminate running paths of Predicates in scheduler

- eliminate running paths of Predicates in scheduler; use Filter Plugins instead.
- refactor all unit tests
- adjust the TestPreemptWithPermitPlugin integration test
This commit is contained in:
Wei Huang
2019-12-10 10:12:03 -08:00
parent 30a5db136f
commit dc3d1bd238
17 changed files with 720 additions and 505 deletions

View File

@@ -124,3 +124,13 @@ func PredicateMetadata(state *framework.CycleState) interface{} {
}
return meta
}
// CovertStateRefToPredMeta checks if 'stateRef' is nil, if it is, return nil;
// otherwise covert it to predicates metadata and return.
func CovertStateRefToPredMeta(stateRef interface{}) (predicates.Metadata, bool) {
if stateRef == nil {
return nil, true
}
meta, ok := stateRef.(predicates.Metadata)
return meta, ok
}