Change ByID boolean to Peer string and add Peer id in replicas output

The CLI will now be able to display the peer IDs in MetaGroupInfo
if it choses to do so, and possibly help user select the peer ID
from a list with a new command to remove by peer ID instead of
by server name.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2022-09-15 10:36:22 -06:00
parent e1f0361b98
commit f113163b9f
5 changed files with 24 additions and 15 deletions

View File

@@ -7317,8 +7317,7 @@ func TestJetStreamClusterRemovePeerByID(t *testing.T) {
require_True(t, IsNatsErr(resp.Error, JSClusterServerNotMemberErr))
// Now try by ID, but first with an ID that does not match any peerID
req.Server = "some_bad_id"
req.ByID = true
req.Peer = "some_bad_id"
jsreq, err = json.Marshal(req)
require_NoError(t, err)
rmsg, err = nc.Request(JSApiRemoveServer, jsreq, 2*time.Second)
@@ -7331,7 +7330,7 @@ func TestJetStreamClusterRemovePeerByID(t *testing.T) {
require_True(t, IsNatsErr(resp.Error, JSClusterServerNotMemberErr))
// Now with the proper peer ID
req.Server = peerID
req.Peer = peerID
jsreq, err = json.Marshal(req)
require_NoError(t, err)
rmsg, err = nc.Request(JSApiRemoveServer, jsreq, 2*time.Second)