This commit is contained in:
Alex Dadgar
2017-02-20 16:43:28 -08:00
parent 69aa5db628
commit ee76b78922
10 changed files with 61 additions and 14 deletions

View File

@@ -568,6 +568,8 @@ func apiTaskToStructsTask(apiTask *api.Task, structsTask *structs.Task) {
ChangeSignal: *template.ChangeSignal,
Splay: *template.Splay,
Perms: *template.Perms,
LeftDelim: *template.LeftDelim,
RightDelim: *template.RightDelim,
}
}
if apiTask.DispatchPayload != nil {

View File

@@ -709,6 +709,7 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
Spec: helper.StringToPtr("spec"),
SpecType: helper.StringToPtr("cron"),
ProhibitOverlap: helper.BoolToPtr(true),
TimeZone: helper.StringToPtr("test zone"),
},
ParameterizedJob: &api.ParameterizedJobConfig{
Payload: "payload",
@@ -747,6 +748,7 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
Tasks: []*api.Task{
{
Name: "task1",
Leader: true,
Driver: "docker",
User: "mary",
Config: map[string]interface{}{
@@ -840,6 +842,8 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
ChangeSignal: helper.StringToPtr("signal"),
Splay: helper.TimeToPtr(1 * time.Minute),
Perms: helper.StringToPtr("666"),
LeftDelim: helper.StringToPtr("abc"),
RightDelim: helper.StringToPtr("def"),
},
},
DispatchPayload: &api.DispatchPayloadConfig{
@@ -882,6 +886,7 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
Spec: "spec",
SpecType: "cron",
ProhibitOverlap: true,
TimeZone: "test zone",
},
ParameterizedJob: &structs.ParameterizedJobConfig{
Payload: "payload",
@@ -921,6 +926,7 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
{
Name: "task1",
Driver: "docker",
Leader: true,
User: "mary",
Config: map[string]interface{}{
"lol": "code",
@@ -1010,6 +1016,8 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
ChangeSignal: "SIGNAL",
Splay: 1 * time.Minute,
Perms: "666",
LeftDelim: "abc",
RightDelim: "def",
},
},
DispatchPayload: &structs.DispatchPayloadConfig{