File tree 1 file changed +1
-23
lines changed
1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -118,30 +118,8 @@ func memberAddCommandFunc(cmd *cobra.Command, args []string) {
118
118
display .MemberAdd (* resp )
119
119
120
120
if _ , ok := (display ).(* simplePrinter ); ok {
121
- ctx , cancel = commandCtx (cmd )
122
- listResp , err := cli .MemberList (ctx )
123
- // make sure the member who served member list request has the latest member list.
124
- syncedMemberSet := make (map [uint64 ]struct {})
125
- syncedMemberSet [resp .Header .MemberId ] = struct {}{} // the member who served member add is guaranteed to have the latest member list.
126
- for {
127
- if err != nil {
128
- ExitWithError (ExitError , err )
129
- }
130
- if _ , ok := syncedMemberSet [listResp .Header .MemberId ]; ok {
131
- break
132
- }
133
- // quorum get to sync cluster list
134
- gresp , gerr := cli .Get (ctx , "_" )
135
- if gerr != nil {
136
- ExitWithError (ExitError , err )
137
- }
138
- syncedMemberSet [gresp .Header .MemberId ] = struct {}{}
139
- listResp , err = cli .MemberList (ctx )
140
- }
141
- cancel ()
142
-
143
121
conf := []string {}
144
- for _ , memb := range listResp .Members {
122
+ for _ , memb := range resp .Members {
145
123
for _ , u := range memb .PeerURLs {
146
124
n := memb .Name
147
125
if memb .ID == newID {
You can’t perform that action at this time.
0 commit comments