address review comments

This commit is contained in:
Mahmood Ali
2020-01-15 08:57:05 -05:00
parent 4f36d4b308
commit 3291523d8c
4 changed files with 26 additions and 23 deletions

View File

@@ -294,16 +294,16 @@ func NewTaskRunner(config *Config) (*TaskRunner, error) {
// Pull out the task's resources
ares := tr.alloc.AllocatedResources
if ares != nil {
tres, ok := ares.Tasks[tr.taskName]
if !ok {
return nil, fmt.Errorf("no task resources found on allocation")
}
tr.taskResources = tres
} else {
if ares == nil {
return nil, fmt.Errorf("no task resources found on allocation")
}
tres, ok := ares.Tasks[tr.taskName]
if !ok {
return nil, fmt.Errorf("no task resources found on allocation")
}
tr.taskResources = tres
// Build the restart tracker.
tg := tr.alloc.Job.LookupTaskGroup(tr.alloc.TaskGroup)
if tg == nil {