From 3bf19b555e70f4d849d62175765b0ff760fc9b70 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Tue, 8 Nov 2016 14:43:46 -0800 Subject: [PATCH] Interpolate all check related variables --- client/driver/executor/executor.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/driver/executor/executor.go b/client/driver/executor/executor.go index 1c6b15744df2..a5df9d9d834c 100644 --- a/client/driver/executor/executor.go +++ b/client/driver/executor/executor.go @@ -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) } }