Skip to content

Commit

Permalink
Template emits events explaining why it is blocked
Browse files Browse the repository at this point in the history
This PR does the following:
* Adds a mechanism to emit events in the TaskRunner
* Vendors a new version of Consul-Template that allows extraction of
missing dependencies
* Adds logic to our consul_template.go to determine missing events and
emit them in a batched fashion.
* Refactors the consul_template code to split the run method and take in
a config struct rather than many parameters.

Fixes #2578
  • Loading branch information
dadgar committed Aug 10, 2017
1 parent 6c0bb2b commit 1e7ae91
Show file tree
Hide file tree
Showing 4 changed files with 467 additions and 196 deletions.
5 changes: 3 additions & 2 deletions client/alloc_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,9 @@ func (r *AllocRunner) setStatus(status, desc string) {
}
}

// setTaskState is used to set the status of a task. If state is empty then the
// event is appended but not synced with the server. The event may be omitted
// setTaskState is used to set the status of a task. If lazySync is set then the
// event is appended but not synced with the server. If state is omitted, the
// last known state is used.
func (r *AllocRunner) setTaskState(taskName, state string, event *structs.TaskEvent, lazySync bool) {
r.taskStatusLock.Lock()
defer r.taskStatusLock.Unlock()
Expand Down
Loading

0 comments on commit 1e7ae91

Please sign in to comment.