diff --git a/scheduler/util.go b/scheduler/util.go index 9a7099987..e3e790fa6 100644 --- a/scheduler/util.go +++ b/scheduler/util.go @@ -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) { diff --git a/scheduler/util_test.go b/scheduler/util_test.go index b9a1109d2..0c6179d28 100644 --- a/scheduler/util_test.go +++ b/scheduler/util_test.go @@ -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) {