nomad: adding name to allocation
This commit is contained in:
parent
b2c15545c8
commit
00b0740914
|
@ -584,6 +584,9 @@ type Allocation struct {
|
|||
// ID of the allocation (UUID)
|
||||
ID string
|
||||
|
||||
// Name is a logical name of the allocation.
|
||||
Name string
|
||||
|
||||
// NodeID is the node this is being placed on
|
||||
NodeID string
|
||||
|
||||
|
@ -720,6 +723,19 @@ func (e *Evaluation) ShouldEnqueue() bool {
|
|||
}
|
||||
}
|
||||
|
||||
// MakePlan is used to make a plan from the given evaluation
|
||||
// for a given Job
|
||||
func (e *Evaluation) MakePlan(j *Job) *Plan {
|
||||
p := &Plan{
|
||||
EvalID: e.ID,
|
||||
Priority: j.Priority,
|
||||
AllAtOnce: j.AllAtOnce,
|
||||
NodeEvict: make(map[string][]string),
|
||||
NodeAllocation: make(map[string][]*Allocation),
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// Plan is used to submit a commit plan for task allocations. These
|
||||
// are submitted to the leader which verifies that resources have
|
||||
// not been overcommitted before admiting the plan.
|
||||
|
|
Loading…
Reference in New Issue