fix up basic test
add conversion for KillSignal for api/struct representation of task
This commit is contained in:
parent
69e4d03694
commit
a010db084b
|
@ -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)
|
||||
|
|
|
@ -202,7 +202,8 @@ func TestParse(t *testing.T) {
|
|||
RightDelim: helper.StringToPtr("__"),
|
||||
},
|
||||
},
|
||||
Leader: true,
|
||||
Leader: true,
|
||||
KillSignal: "",
|
||||
},
|
||||
{
|
||||
Name: "storagelocker",
|
||||
|
|
Loading…
Reference in New Issue