mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Correct defaulting
This commit is contained in:
committed by
Michael Schurter
parent
478209807e
commit
7f989499ff
@@ -649,6 +649,15 @@ func ApiTgToStructsTG(taskGroup *api.TaskGroup, tg *structs.TaskGroup) {
|
||||
}
|
||||
}
|
||||
|
||||
if taskGroup.Migrate != nil {
|
||||
tg.Migrate = &structs.MigrateStrategy{
|
||||
MaxParallel: *taskGroup.Migrate.MaxParallel,
|
||||
HealthCheck: *taskGroup.Migrate.HealthCheck,
|
||||
MinHealthyTime: *taskGroup.Migrate.MinHealthyTime,
|
||||
HealthyDeadline: *taskGroup.Migrate.HealthyDeadline,
|
||||
}
|
||||
}
|
||||
|
||||
tg.EphemeralDisk = &structs.EphemeralDisk{
|
||||
Sticky: *taskGroup.EphemeralDisk.Sticky,
|
||||
SizeMB: *taskGroup.EphemeralDisk.SizeMB,
|
||||
|
||||
@@ -1179,6 +1179,12 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
|
||||
Unlimited: helper.BoolToPtr(true),
|
||||
MaxDelay: helper.TimeToPtr(20 * time.Minute),
|
||||
},
|
||||
Migrate: &api.MigrateStrategy{
|
||||
MaxParallel: helper.IntToPtr(12),
|
||||
HealthCheck: helper.StringToPtr("task_events"),
|
||||
MinHealthyTime: helper.TimeToPtr(12 * time.Hour),
|
||||
HealthyDeadline: helper.TimeToPtr(12 * time.Hour),
|
||||
},
|
||||
EphemeralDisk: &api.EphemeralDisk{
|
||||
SizeMB: helper.IntToPtr(100),
|
||||
Sticky: helper.BoolToPtr(true),
|
||||
@@ -1395,6 +1401,12 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
|
||||
Unlimited: true,
|
||||
MaxDelay: 20 * time.Minute,
|
||||
},
|
||||
Migrate: &structs.MigrateStrategy{
|
||||
MaxParallel: 12,
|
||||
HealthCheck: "task_events",
|
||||
MinHealthyTime: 12 * time.Hour,
|
||||
HealthyDeadline: 12 * time.Hour,
|
||||
},
|
||||
EphemeralDisk: &structs.EphemeralDisk{
|
||||
SizeMB: 100,
|
||||
Sticky: true,
|
||||
|
||||
Reference in New Issue
Block a user