From 69e7d21e9a08cf0862c17449daee4225a09dadaa Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Sun, 4 Oct 2015 15:53:02 -0400 Subject: [PATCH] scheduler: tasks updated should only check if number of dynamic ports is different --- scheduler/util.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scheduler/util.go b/scheduler/util.go index cf7224a16..cae0043ab 100644 --- a/scheduler/util.go +++ b/scheduler/util.go @@ -228,10 +228,17 @@ func tasksUpdated(a, b *structs.TaskGroup) bool { return true } - // Inspect the network to see if the resource ask is different - if !reflect.DeepEqual(at.Resources.Networks, bt.Resources.Networks) { + // Inspect the network to see if the dynamic ports are different + if len(at.Resources.Networks) != len(bt.Resources.Networks) { return true } + for idx := range at.Resources.Networks { + an := at.Resources.Networks[idx] + bn := bt.Resources.Networks[idx] + if len(an.DynamicPorts) != len(bn.DynamicPorts) { + return true + } + } } return false }