mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Adding the summary to the Job Stub
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user