add dc and region to task env building function. flipped order of a couple functions to be consistent with the ordering of the rest of that section.

This commit is contained in:
Kate Taggart 2017-03-29 15:21:21 -07:00 committed by Alex Dadgar
parent e572ec8997
commit 2062d5d1dc
1 changed files with 10 additions and 4 deletions

View File

@ -203,6 +203,12 @@ func (t *TaskEnvironment) Build() *TaskEnvironment {
if t.JobName != "" { if t.JobName != "" {
t.TaskEnv[JobName] = t.JobName t.TaskEnv[JobName] = t.JobName
} }
if t.Datacenter != "" {
t.TaskEnv[Datacenter] = t.Datacenter
}
if t.Region != "" {
t.TaskEnv[Region] = t.Region
}
// Build the addr of the other tasks // Build the addr of the other tasks
if t.Alloc != nil { if t.Alloc != nil {
@ -496,13 +502,13 @@ func (t *TaskEnvironment) SetTaskName(name string) *TaskEnvironment {
return t return t
} }
func (t *TaskEnvironment) SetJobName(name string) *TaskEnvironment { func (t *TaskEnvironment) ClearTaskName() *TaskEnvironment {
t.JobName = name t.TaskName = ""
return t return t
} }
func (t *TaskEnvironment) ClearTaskName() *TaskEnvironment { func (t *TaskEnvironment) SetJobName(name string) *TaskEnvironment {
t.TaskName = "" t.JobName = name
return t return t
} }