nomad: adding name to allocation

This commit is contained in:
Armon Dadgar 2015-08-11 16:34:06 -07:00
parent b2c15545c8
commit 00b0740914

View file

@ -584,6 +584,9 @@ type Allocation struct {
// ID of the allocation (UUID) // ID of the allocation (UUID)
ID string ID string
// Name is a logical name of the allocation.
Name string
// NodeID is the node this is being placed on // NodeID is the node this is being placed on
NodeID string 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 // Plan is used to submit a commit plan for task allocations. These
// are submitted to the leader which verifies that resources have // are submitted to the leader which verifies that resources have
// not been overcommitted before admiting the plan. // not been overcommitted before admiting the plan.