Commit 252a9561 authored by Hongchao Deng's avatar Hongchao Deng

return error if got InsufficientResourceError and fit=true

parent 111b603c
......@@ -129,8 +129,12 @@ func findNodesThatFit(pod *api.Pod, machineToPods map[string][]*api.Pod, predica
for name, predicate := range predicateFuncs {
fit, err := predicate(pod, machineToPods[node.Name], node.Name)
if err != nil {
switch err.(type) {
switch e := err.(type) {
case *predicates.InsufficientResourceError:
if fit {
err := fmt.Errorf("got InsufficientResourceError: %v, but also fit='true' which is unexpected", e)
return api.NodeList{}, FailedPredicateMap{}, err
}
default:
return api.NodeList{}, FailedPredicateMap{}, err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment