open-nomad/client/allocrunnerdeprecated/taskrunner/getters.go
2018-10-16 16:56:55 -07:00

20 lines
333 B
Go

package taskrunner
// Name returns the name of the task
func (r *TaskRunner) Name() string {
if r == nil || r.task == nil {
return ""
}
return r.task.Name
}
// IsLeader returns whether the task is a leader task
func (r *TaskRunner) IsLeader() bool {
if r == nil || r.task == nil {
return false
}
return r.task.Leader
}