nomad: associate alloc with eval

This commit is contained in:
Armon Dadgar 2015-08-15 13:08:06 -07:00
parent aadecdd805
commit 6738e9fe08
2 changed files with 18 additions and 6 deletions

View File

@ -230,12 +230,8 @@ const (
// VersionResponse is used for the Status.Version reseponse // VersionResponse is used for the Status.Version reseponse
type VersionResponse struct { type VersionResponse struct {
Build string Build string
Versions map[string]int Versions map[string]int
ProtocolVersion int
APIMajorVersion int
APIMinorVersion int
Flags map[string]int
QueryMeta QueryMeta
} }
@ -372,6 +368,9 @@ type Node struct {
// Status of this node // Status of this node
Status string Status string
// StatusDescription is meant to provide more human useful information
StatusDescription string
// Raft Indexes // Raft Indexes
CreateIndex uint64 CreateIndex uint64
ModifyIndex uint64 ModifyIndex uint64
@ -545,6 +544,9 @@ type Job struct {
// Job status // Job status
Status string Status string
// StatusDescription is meant to provide more human useful information
StatusDescription string
// Raft Indexes // Raft Indexes
CreateIndex uint64 CreateIndex uint64
ModifyIndex uint64 ModifyIndex uint64
@ -624,6 +626,9 @@ type Allocation struct {
// ID of the allocation (UUID) // ID of the allocation (UUID)
ID string ID string
// ID of the evaluation that generated this allocation
EvalID string
// Name is a logical name of the allocation. // Name is a logical name of the allocation.
Name string Name string
@ -646,6 +651,9 @@ type Allocation struct {
// Status of the allocation // Status of the allocation
Status string Status string
// StatusDescription is meant to provide more human useful information
StatusDescription string
// Raft Indexes // Raft Indexes
CreateIndex uint64 CreateIndex uint64
ModifyIndex uint64 ModifyIndex uint64
@ -773,6 +781,9 @@ type Evaluation struct {
// Status of the evaluation // Status of the evaluation
Status string Status string
// StatusDescription is meant to provide more human useful information
StatusDescription string
// Raft Indexes // Raft Indexes
CreateIndex uint64 CreateIndex uint64
ModifyIndex uint64 ModifyIndex uint64

View File

@ -205,6 +205,7 @@ func (s *GenericScheduler) computePlacements(job *structs.Job, place []allocTupl
// Create an allocation for this // Create an allocation for this
alloc := &structs.Allocation{ alloc := &structs.Allocation{
ID: mock.GenerateUUID(), ID: mock.GenerateUUID(),
EvalID: s.eval.ID,
Name: missing.Name, Name: missing.Name,
NodeID: option.Node.ID, NodeID: option.Node.ID,
JobID: job.ID, JobID: job.ID,