fix up basic test

add conversion for KillSignal for api/struct representation of task
This commit is contained in:
Chelsea Holland Komlo 2017-12-06 13:50:22 -05:00
parent 69e4d03694
commit a010db084b
2 changed files with 5 additions and 1 deletions

View File

@ -666,6 +666,8 @@ func ApiTgToStructsTG(taskGroup *api.TaskGroup, tg *structs.TaskGroup) {
}
}
// ApiTaskToStructsTask is a copy and type conversion between the API
// representation of a task from a struct representation of a task.
func ApiTaskToStructsTask(apiTask *api.Task, structsTask *structs.Task) {
structsTask.Name = apiTask.Name
structsTask.Driver = apiTask.Driver
@ -676,6 +678,7 @@ func ApiTaskToStructsTask(apiTask *api.Task, structsTask *structs.Task) {
structsTask.Meta = apiTask.Meta
structsTask.KillTimeout = *apiTask.KillTimeout
structsTask.ShutdownDelay = apiTask.ShutdownDelay
structsTask.KillSignal = apiTask.KillSignal
if l := len(apiTask.Constraints); l != 0 {
structsTask.Constraints = make([]*structs.Constraint, l)

View File

@ -202,7 +202,8 @@ func TestParse(t *testing.T) {
RightDelim: helper.StringToPtr("__"),
},
},
Leader: true,
Leader: true,
KillSignal: "",
},
{
Name: "storagelocker",