nomad: rename util method
This commit is contained in:
parent
eafa8ccd21
commit
194723e7bf
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue