diff --git a/nomad/job_endpoint.go b/nomad/job_endpoint.go index a2944fcae..809219dbc 100644 --- a/nomad/job_endpoint.go +++ b/nomad/job_endpoint.go @@ -368,7 +368,8 @@ func (j *Job) List(args *structs.JobListRequest, break } job := raw.(*structs.Job) - jobs = append(jobs, job.Stub()) + summary, _ := snap.JobSummaryByID(job.ID) + jobs = append(jobs, job.Stub(summary)) } reply.Jobs = jobs diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 8e0bf6fc1..2e7d65b31 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -1195,7 +1195,7 @@ func (j *Job) LookupTaskGroup(name string) *TaskGroup { } // Stub is used to return a summary of the job -func (j *Job) Stub() *JobListStub { +func (j *Job) Stub(summary *JobSummary) *JobListStub { return &JobListStub{ ID: j.ID, ParentID: j.ParentID, @@ -1207,6 +1207,7 @@ func (j *Job) Stub() *JobListStub { CreateIndex: j.CreateIndex, ModifyIndex: j.ModifyIndex, JobModifyIndex: j.JobModifyIndex, + JobSummary: summary, } } @@ -1228,6 +1229,7 @@ type JobListStub struct { CreateIndex uint64 ModifyIndex uint64 JobModifyIndex uint64 + JobSummary *JobSummary } // UpdateStrategy is used to modify how updates are done