Skip to content

Commit

Permalink
Merge pull request #1966 from hashicorp/b-service-interpolate
Browse files Browse the repository at this point in the history
Interpolate all service/check fields
  • Loading branch information
dadgar committed Nov 8, 2016
2 parents a90b84a + 3bf19b5 commit ec103e1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions client/driver/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -745,15 +745,17 @@ func (e *UniversalExecutor) interpolateServices(task *structs.Task) {
e.ctx.TaskEnv.Build()
for _, service := range task.Services {
for _, check := range service.Checks {
if check.Type == structs.ServiceCheckScript {
check.Name = e.ctx.TaskEnv.ReplaceEnv(check.Name)
check.Command = e.ctx.TaskEnv.ReplaceEnv(check.Command)
check.Args = e.ctx.TaskEnv.ParseAndReplace(check.Args)
check.Path = e.ctx.TaskEnv.ReplaceEnv(check.Path)
check.Protocol = e.ctx.TaskEnv.ReplaceEnv(check.Protocol)
}
check.Name = e.ctx.TaskEnv.ReplaceEnv(check.Name)
check.Type = e.ctx.TaskEnv.ReplaceEnv(check.Type)
check.Command = e.ctx.TaskEnv.ReplaceEnv(check.Command)
check.Args = e.ctx.TaskEnv.ParseAndReplace(check.Args)
check.Path = e.ctx.TaskEnv.ReplaceEnv(check.Path)
check.Protocol = e.ctx.TaskEnv.ReplaceEnv(check.Protocol)
check.PortLabel = e.ctx.TaskEnv.ReplaceEnv(check.PortLabel)
check.InitialStatus = e.ctx.TaskEnv.ReplaceEnv(check.InitialStatus)
}
service.Name = e.ctx.TaskEnv.ReplaceEnv(service.Name)
service.PortLabel = e.ctx.TaskEnv.ReplaceEnv(service.PortLabel)
service.Tags = e.ctx.TaskEnv.ParseAndReplace(service.Tags)
}
}
Expand Down

0 comments on commit ec103e1

Please sign in to comment.