mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 11:47:36 +08:00
[REV] optimize grctl node un/re scheduable command,node who have compute can exec this cmd
This commit is contained in:
parent
42afa03e72
commit
28da841b50
@ -222,8 +222,8 @@ func NewCmdNode() cli.Command {
|
||||
return nil
|
||||
}
|
||||
node := clients.NodeClient.Nodes().Get(id)
|
||||
if node.Node.Role.HasRule("manage") {
|
||||
logrus.Errorf("管理节点不支持此功能")
|
||||
if !node.Node.Role.HasRule("compute") {
|
||||
logrus.Errorf("计算节点支持此功能,请检查角色")
|
||||
return nil
|
||||
}
|
||||
clients.NodeClient.Nodes().Get(id).UnSchedulable()
|
||||
@ -240,8 +240,8 @@ func NewCmdNode() cli.Command {
|
||||
return nil
|
||||
}
|
||||
node := clients.NodeClient.Nodes().Get(id)
|
||||
if node.Node.Role.HasRule("manage") {
|
||||
logrus.Errorf("管理节点不支持此功能")
|
||||
if !node.Node.Role.HasRule("compute") {
|
||||
logrus.Errorf("计算节点支持此功能,请检查角色")
|
||||
return nil
|
||||
}
|
||||
clients.NodeClient.Nodes().Get(id).ReSchedulable()
|
||||
|
Loading…
Reference in New Issue
Block a user