scheduler: tasks updated should only check if number of dynamic ports is different

This commit is contained in:
Armon Dadgar
2015-10-04 15:53:02 -04:00
parent be30e4f787
commit 69e7d21e9a

View File

@@ -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
}