Skip to content

Commit

Permalink
Merge pull request #1106 from hashicorp/b-drain-system-job
Browse files Browse the repository at this point in the history
Always trigger evals on drain update
  • Loading branch information
dadgar committed Apr 19, 2016
2 parents 37a0c20 + b14a4f1 commit c09b058
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions nomad/node_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c09b058

Please sign in to comment.