Properly interpolate services on updated tasks

Previously was interpolating the original task's services again.

Fixes #2180

Also fixes a slight memory leak in the new consul agent. Script check
handles weren't being deleted after cancellation.
This commit is contained in:
Michael Schurter
2017-04-26 11:22:01 -07:00
parent af5a6787c7
commit 92535496b4
4 changed files with 93 additions and 5 deletions

View File

@@ -1442,7 +1442,7 @@ func (r *TaskRunner) updateServices(d driver.Driver, h driver.ScriptExecutor, ol
// Allow set the script executor if the driver supports it
exec = h
}
interpolateServices(r.getTaskEnv(), r.task)
interpolateServices(r.getTaskEnv(), new)
return r.consul.UpdateTask(r.alloc.ID, old, new, exec)
}