formerly, devtools
(ctx *Ctx, proxyURL string, node *cluster.Snode, timeout time.Duration)
| 702 | // formerly, devtools |
| 703 | // |
| 704 | func _joinCluster(ctx *Ctx, proxyURL string, node *cluster.Snode, timeout time.Duration) (rebID string, err error) { |
| 705 | baseParams := api.BaseParams{Client: ctx.Client, URL: proxyURL, Token: LoggedUserToken} |
| 706 | smap, err := api.GetClusterMap(baseParams) |
| 707 | if err != nil { |
| 708 | return "", err |
| 709 | } |
| 710 | if rebID, _, err = api.JoinCluster(baseParams, node); err != nil { |
| 711 | return |
| 712 | } |
| 713 | |
| 714 | // If node is already in cluster we should not wait for map version |
| 715 | // sync because update will not be scheduled |
| 716 | if node := smap.GetNode(node.ID()); node == nil { |
| 717 | err = _waitMapVersionSync(baseParams, ctx, time.Now().Add(timeout), smap, smap.Version, cos.NewStringSet()) |
| 718 | return |
| 719 | } |
| 720 | return |
| 721 | } |
| 722 | |
| 723 | func _nextNode(smap *cluster.Smap, idsToIgnore cos.StringSet) (string, string, bool) { |
| 724 | for _, d := range smap.Pmap { |
no test coverage detected