diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 926b667ef..628339232 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -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 } diff --git a/scheduler/service_sched.go b/scheduler/service_sched.go index 88eb76cd5..b50fc206e 100644 --- a/scheduler/service_sched.go +++ b/scheduler/service_sched.go @@ -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 {