Skip to content

Commit

Permalink
use triOpt in node set (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS authored Jul 27, 2020
1 parent 4af90c7 commit d9015db
Show file tree
Hide file tree
Showing 6 changed files with 284 additions and 291 deletions.
3 changes: 1 addition & 2 deletions cluster/calcium/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package calcium
import (
"context"

"github.com/projecteru2/core/cluster"
"github.com/projecteru2/core/types"
"github.com/sanity-io/litter"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -39,7 +38,7 @@ func (c *Calcium) SetNode(ctx context.Context, opts *types.SetNodeOptions) (*typ
opts.Normalize(node)
n = node
litter.Dump(opts)
n.Available = (opts.Status == cluster.NodeUp) || (opts.Status == cluster.KeepNodeStatus && n.Available)
n.Available = (opts.Status == types.TriTrue) || (opts.Status == types.TriKeep && n.Available)
if opts.ContainersDown {
containers, err := c.store.ListNodeContainers(ctx, opts.Nodename, nil)
if err != nil {
Expand Down
6 changes: 0 additions & 6 deletions cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ const (
ContainerLock = "clock_%s"
// NodeLock for lock node
NodeLock = "cnode_%s_%s"
// NodeUp for node up
NodeUp = 1
// NodeDown for node down
NodeDown = 0
// KeepNodeStatus for no change node status
KeepNodeStatus = 2
)

// Cluster define all interface
Expand Down
Loading

0 comments on commit d9015db

Please sign in to comment.