mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 19:57:42 +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
|
return nil
|
||||||
}
|
}
|
||||||
node := clients.NodeClient.Nodes().Get(id)
|
node := clients.NodeClient.Nodes().Get(id)
|
||||||
if node.Node.Role.HasRule("manage") {
|
if !node.Node.Role.HasRule("compute") {
|
||||||
logrus.Errorf("管理节点不支持此功能")
|
logrus.Errorf("计算节点支持此功能,请检查角色")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
clients.NodeClient.Nodes().Get(id).UnSchedulable()
|
clients.NodeClient.Nodes().Get(id).UnSchedulable()
|
||||||
@ -240,8 +240,8 @@ func NewCmdNode() cli.Command {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
node := clients.NodeClient.Nodes().Get(id)
|
node := clients.NodeClient.Nodes().Get(id)
|
||||||
if node.Node.Role.HasRule("manage") {
|
if !node.Node.Role.HasRule("compute") {
|
||||||
logrus.Errorf("管理节点不支持此功能")
|
logrus.Errorf("计算节点支持此功能,请检查角色")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
clients.NodeClient.Nodes().Get(id).ReSchedulable()
|
clients.NodeClient.Nodes().Get(id).ReSchedulable()
|
||||||
|
Loading…
Reference in New Issue
Block a user