From 194723e7bf27f004d2258399d400dc08fa520036 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Thu, 13 Aug 2015 16:40:51 -0700 Subject: [PATCH] nomad: rename util method --- nomad/client_endpoint.go | 4 ++-- nomad/structs/structs.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nomad/client_endpoint.go b/nomad/client_endpoint.go index 3b9abe338..0b3ffc672 100644 --- a/nomad/client_endpoint.go +++ b/nomad/client_endpoint.go @@ -51,7 +51,7 @@ func (c *Client) Register(args *structs.NodeRegisterRequest, reply *structs.Node reply.NodeModifyIndex = index // Check if we should trigger evaluations - if structs.ShouldEvaluateNode(args.Node.Status) { + if structs.ShouldDrainNode(args.Node.Status) { evalIDs, evalIndex, err := c.createNodeEvals(args.Node.ID, index) if err != nil { c.srv.logger.Printf("[ERR] nomad.client: eval creation failed: %v", err) @@ -125,7 +125,7 @@ func (c *Client) UpdateStatus(args *structs.NodeUpdateStatusRequest, reply *stru reply.NodeModifyIndex = index // Check if we should trigger evaluations - if structs.ShouldEvaluateNode(args.Status) { + if structs.ShouldDrainNode(args.Status) { evalIDs, evalIndex, err := c.createNodeEvals(args.NodeID, index) if err != nil { c.srv.logger.Printf("[ERR] nomad.client: eval creation failed: %v", err) diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 628339232..53b74d35a 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -279,9 +279,9 @@ const ( NodeStatusDown = "down" ) -// ShouldEvaluateNode checks if a given node status should trigger an +// ShouldDrainNode checks if a given node status should trigger an // evaluation. Some states don't require any further action. -func ShouldEvaluateNode(status string) bool { +func ShouldDrainNode(status string) bool { switch status { case NodeStatusInit, NodeStatusReady, NodeStatusMaint: return false