mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 02:45:42 +03:00
scheduler: simplify eviction logic
This commit is contained in:
@@ -739,11 +739,13 @@ func (e *Evaluation) ShouldEnqueue() bool {
|
||||
func (e *Evaluation) MakePlan(j *Job) *Plan {
|
||||
p := &Plan{
|
||||
EvalID: e.ID,
|
||||
Priority: j.Priority,
|
||||
AllAtOnce: j.AllAtOnce,
|
||||
Priority: e.Priority,
|
||||
NodeEvict: make(map[string][]string),
|
||||
NodeAllocation: make(map[string][]*Allocation),
|
||||
}
|
||||
if j != nil {
|
||||
p.AllAtOnce = j.AllAtOnce
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
|
||||
@@ -317,11 +317,7 @@ START:
|
||||
}
|
||||
|
||||
// Create a plan to evict these
|
||||
plan := &structs.Plan{
|
||||
EvalID: eval.ID,
|
||||
Priority: eval.Priority,
|
||||
NodeEvict: make(map[string][]string),
|
||||
}
|
||||
plan := eval.MakePlan(nil)
|
||||
|
||||
// Add each alloc to be evicted
|
||||
for _, alloc := range allocs {
|
||||
|
||||
Reference in New Issue
Block a user