Skip to content

Commit

Permalink
Merge pull request #2302 from hashicorp/f-task-state-setup
Browse files Browse the repository at this point in the history
Adding a task event for setup
  • Loading branch information
dadgar committed Feb 23, 2017
2 parents 85a59d3 + 7447ccd commit c89d824
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 128 deletions.
1 change: 1 addition & 0 deletions api/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ type TaskState struct {
}

const (
TaskSetup = "Task Setup"
TaskSetupFailure = "Setup Failure"
TaskDriverFailure = "Driver Failure"
TaskDriverMessage = "Driver"
Expand Down
3 changes: 3 additions & 0 deletions client/task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,9 @@ func (r *TaskRunner) buildTaskDir(fsi cstructs.FSIsolation) error {
}
r.persistLock.Unlock()

r.setState(structs.TaskStatePending, structs.NewTaskEvent(structs.TaskSetup).
SetMessage(structs.TaskBuildingTaskDir))

chroot := config.DefaultChrootEnv
if len(r.config.ChrootEnv) > 0 {
chroot = r.config.ChrootEnv
Expand Down
Loading

0 comments on commit c89d824

Please sign in to comment.