tasks updated

This commit is contained in:
Alex Dadgar 2016-09-21 11:29:50 -07:00
parent 12de69a66f
commit bc500a536c
2 changed files with 9 additions and 0 deletions

View file

@ -359,6 +359,9 @@ func tasksUpdated(a, b *structs.TaskGroup) bool {
if !reflect.DeepEqual(at.Artifacts, bt.Artifacts) {
return true
}
if !reflect.DeepEqual(at.Vault, bt.Vault) {
return true
}
// Inspect the network to see if the dynamic ports are different
if len(at.Resources.Networks) != len(bt.Resources.Networks) {

View file

@ -540,6 +540,12 @@ func TestTasksUpdated(t *testing.T) {
if !tasksUpdated(j1.TaskGroups[0], j14.TaskGroups[0]) {
t.Fatalf("bad")
}
j15 := mock.Job()
j15.TaskGroups[0].Tasks[0].Vault = &structs.Vault{Policies: []string{"foo"}}
if !tasksUpdated(j1.TaskGroups[0], j15.TaskGroups[0]) {
t.Fatalf("bad")
}
}
func TestEvictAndPlace_LimitLessThanAllocs(t *testing.T) {