Skip to content

Commit

Permalink
Add leader and timezone to conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Feb 21, 2017
1 parent 909ae26 commit 69aa5db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ type Task struct {
Vault *Vault
Templates []*Template
DispatchPayload *DispatchPayloadConfig
Leader *bool
Leader bool
}

func (t *Task) Canonicalize() {
Expand Down
2 changes: 2 additions & 0 deletions command/agent/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ func apiJobToStructJob(job *api.Job) *structs.Job {
Enabled: *job.Periodic.Enabled,
SpecType: *job.Periodic.SpecType,
ProhibitOverlap: *job.Periodic.ProhibitOverlap,
TimeZone: *job.Periodic.TimeZone,
}
if job.Periodic.Spec != nil {
j.Periodic.Spec = *job.Periodic.Spec
Expand Down Expand Up @@ -476,6 +477,7 @@ func apiTaskToStructsTask(apiTask *api.Task, structsTask *structs.Task) {
structsTask.Name = apiTask.Name
structsTask.Driver = apiTask.Driver
structsTask.User = apiTask.User
structsTask.Leader = apiTask.Leader
structsTask.Config = apiTask.Config
structsTask.Constraints = make([]*structs.Constraint, len(apiTask.Constraints))
for i, constraint := range apiTask.Constraints {
Expand Down

0 comments on commit 69aa5db

Please sign in to comment.