From b14a4f15655ff069ba993f8c90192e1e185ede95 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Mon, 18 Apr 2016 18:43:52 -0700 Subject: [PATCH] Always trigger evals on drain update --- nomad/node_endpoint.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/nomad/node_endpoint.go b/nomad/node_endpoint.go index 95980f37273..a232dc5445b 100644 --- a/nomad/node_endpoint.go +++ b/nomad/node_endpoint.go @@ -247,16 +247,15 @@ func (n *Node) UpdateDrain(args *structs.NodeUpdateDrainRequest, reply.NodeModifyIndex = index } - // Check if we should trigger evaluations - if args.Drain { - evalIDs, evalIndex, err := n.createNodeEvals(args.NodeID, index) - if err != nil { - n.srv.logger.Printf("[ERR] nomad.client: eval creation failed: %v", err) - return err - } - reply.EvalIDs = evalIDs - reply.EvalCreateIndex = evalIndex + // Always attempt to create Node evaluations because there may be a System + // job registered that should be evaluated. + evalIDs, evalIndex, err := n.createNodeEvals(args.NodeID, index) + if err != nil { + n.srv.logger.Printf("[ERR] nomad.client: eval creation failed: %v", err) + return err } + reply.EvalIDs = evalIDs + reply.EvalCreateIndex = evalIndex // Set the reply index reply.Index = index