diff --git a/command/status.go b/command/status.go index 27e51ece6..128e7efc3 100644 --- a/command/status.go +++ b/command/status.go @@ -47,7 +47,8 @@ Status Options: Display the evaluations associated with the job. -all-allocs - Display the allocs that matches the job name. + Display all allocations matching the job ID, including those from an older + instance of the job. -verbose Display full information. diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index a867b8111..671222ef8 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -1100,9 +1100,9 @@ func (s *StateStore) AllocsByJob(jobID string, all bool) ([]*structs.Allocation, } alloc := raw.(*structs.Allocation) - // If the allocation belongs to a job with the same ID but a diff create - // index and we are not getting all the allocations whose Jobs matches - // the same Job ID then we skip it + // If the allocation belongs to a job with the same ID but a different + // create index and we are not getting all the allocations whose Jobs + // matches the same Job ID then we skip it if !all && job != nil && alloc.Job.CreateIndex != job.CreateIndex { continue }