From 67833ebd9d8b938385ac3e426f55d7bc8e89fa6e Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Sat, 15 Aug 2015 13:08:06 -0700 Subject: [PATCH] nomad: associate alloc with eval --- nomad/structs/structs.go | 23 +++++++++++++++++------ scheduler/generic_sched.go | 1 + 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index ab9f9020f..218a3a677 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -230,12 +230,8 @@ const ( // VersionResponse is used for the Status.Version reseponse type VersionResponse struct { - Build string - Versions map[string]int - ProtocolVersion int - APIMajorVersion int - APIMinorVersion int - Flags map[string]int + Build string + Versions map[string]int QueryMeta } @@ -372,6 +368,9 @@ type Node struct { // Status of this node Status string + // StatusDescription is meant to provide more human useful information + StatusDescription string + // Raft Indexes CreateIndex uint64 ModifyIndex uint64 @@ -545,6 +544,9 @@ type Job struct { // Job status Status string + // StatusDescription is meant to provide more human useful information + StatusDescription string + // Raft Indexes CreateIndex uint64 ModifyIndex uint64 @@ -624,6 +626,9 @@ type Allocation struct { // ID of the allocation (UUID) ID string + // ID of the evaluation that generated this allocation + EvalID string + // Name is a logical name of the allocation. Name string @@ -646,6 +651,9 @@ type Allocation struct { // Status of the allocation Status string + // StatusDescription is meant to provide more human useful information + StatusDescription string + // Raft Indexes CreateIndex uint64 ModifyIndex uint64 @@ -773,6 +781,9 @@ type Evaluation struct { // Status of the evaluation Status string + // StatusDescription is meant to provide more human useful information + StatusDescription string + // Raft Indexes CreateIndex uint64 ModifyIndex uint64 diff --git a/scheduler/generic_sched.go b/scheduler/generic_sched.go index 7594e3260..9b69ac957 100644 --- a/scheduler/generic_sched.go +++ b/scheduler/generic_sched.go @@ -205,6 +205,7 @@ func (s *GenericScheduler) computePlacements(job *structs.Job, place []allocTupl // Create an allocation for this alloc := &structs.Allocation{ ID: mock.GenerateUUID(), + EvalID: s.eval.ID, Name: missing.Name, NodeID: option.Node.ID, JobID: job.ID,