mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 11:47:36 +08:00
[REV]
This commit is contained in:
parent
56adf09ca2
commit
ee2afcc226
@ -285,6 +285,7 @@ func (n *NodeService) InstallNode(nodeID string) *utils.APIHandleError {
|
||||
func (n *NodeService) InitStatus(nodeIP string) (*model.InitStatus, *utils.APIHandleError) {
|
||||
var hostnode client.HostNode
|
||||
gotNode := false
|
||||
var status model.InitStatus
|
||||
i := 0
|
||||
for !gotNode && i < 3 {
|
||||
list, err := n.GetAllNode()
|
||||
@ -305,14 +306,15 @@ func (n *NodeService) InitStatus(nodeIP string) (*model.InitStatus, *utils.APIHa
|
||||
i++
|
||||
}
|
||||
if i != 10 {
|
||||
return nil, utils.CreateAPIHandleError(400, fmt.Errorf("can't find node with given ip %s", nodeIP))
|
||||
status.Status = 3
|
||||
status.StatusCN = "等待节点加入集群中"
|
||||
return &status, nil
|
||||
}
|
||||
nodeUID := hostnode.ID
|
||||
node, err := n.GetNode(nodeUID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var status model.InitStatus
|
||||
for _, val := range node.NodeStatus.Conditions {
|
||||
if node.Alived || (val.Type == client.NodeInit && val.Status == client.ConditionTrue) {
|
||||
status.Status = 0
|
||||
|
Loading…
Reference in New Issue
Block a user