fix validation tests
This commit is contained in:
parent
e0114fee05
commit
af09ef0832
|
@ -1875,7 +1875,9 @@ func (t *Task) Canonicalize(job *Job, tg *TaskGroup) {
|
|||
service.Canonicalize(job.Name, tg.Name, t.Name)
|
||||
}
|
||||
|
||||
t.Resources.Canonicalize()
|
||||
if t.Resources != nil {
|
||||
t.Resources.Canonicalize()
|
||||
}
|
||||
|
||||
// Set the default timeout if it is not specified.
|
||||
if t.KillTimeout == 0 {
|
||||
|
|
|
@ -88,7 +88,7 @@ func TestJob_Validate(t *testing.T) {
|
|||
if !strings.Contains(mErr.Errors[1].Error(), "group 3 missing name") {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
if !strings.Contains(mErr.Errors[2].Error(), "Task group 1 validation failed") {
|
||||
if !strings.Contains(mErr.Errors[2].Error(), "Task group web validation failed") {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
}
|
||||
|
@ -258,6 +258,7 @@ func TestTaskGroup_Validate(t *testing.T) {
|
|||
Mode: RestartPolicyModeDelay,
|
||||
},
|
||||
}
|
||||
|
||||
err = tg.Validate()
|
||||
mErr = err.(*multierror.Error)
|
||||
if !strings.Contains(mErr.Errors[0].Error(), "2 redefines 'web' from task 1") {
|
||||
|
@ -266,7 +267,7 @@ func TestTaskGroup_Validate(t *testing.T) {
|
|||
if !strings.Contains(mErr.Errors[1].Error(), "Task 3 missing name") {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
if !strings.Contains(mErr.Errors[2].Error(), "Task 1 validation failed") {
|
||||
if !strings.Contains(mErr.Errors[2].Error(), "Task web validation failed") {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue