mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 00:15:43 +03:00
API defaults use structs default
This commit is contained in:
12
api/jobs.go
12
api/jobs.go
@@ -332,24 +332,26 @@ func (u *UpdateStrategy) Canonicalize() {
|
||||
u.MaxParallel = helper.IntToPtr(0)
|
||||
}
|
||||
|
||||
d := structs.DefaultUpdateStrategy
|
||||
|
||||
if u.HealthCheck == nil {
|
||||
u.HealthCheck = helper.StringToPtr(structs.UpdateStrategyHealthCheck_Checks)
|
||||
u.HealthCheck = helper.StringToPtr(d.HealthCheck)
|
||||
}
|
||||
|
||||
if u.HealthyDeadline == nil {
|
||||
u.HealthyDeadline = helper.TimeToPtr(5 * time.Minute)
|
||||
u.HealthyDeadline = helper.TimeToPtr(d.HealthyDeadline)
|
||||
}
|
||||
|
||||
if u.MinHealthyTime == nil {
|
||||
u.MinHealthyTime = helper.TimeToPtr(10 * time.Second)
|
||||
u.MinHealthyTime = helper.TimeToPtr(d.MinHealthyTime)
|
||||
}
|
||||
|
||||
if u.AutoRevert == nil {
|
||||
u.AutoRevert = helper.BoolToPtr(false)
|
||||
u.AutoRevert = helper.BoolToPtr(d.AutoRevert)
|
||||
}
|
||||
|
||||
if u.Canary == nil {
|
||||
u.Canary = helper.IntToPtr(0)
|
||||
u.Canary = helper.IntToPtr(d.Canary)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1667,7 +1667,7 @@ const (
|
||||
|
||||
var (
|
||||
// DefaultUpdateStrategy provides a baseline that can be used to upgrade
|
||||
// jobs with the old policy
|
||||
// jobs with the old policy or for populating field defaults.
|
||||
DefaultUpdateStrategy = &UpdateStrategy{
|
||||
MaxParallel: 0,
|
||||
HealthCheck: UpdateStrategyHealthCheck_Checks,
|
||||
|
||||
Reference in New Issue
Block a user