|
@@ -381,19 +381,19 @@ func TestNodeToMemberBad(t *testing.T) {
|
|
|
{Key: "/1234/dynamic", Value: stringp("garbage")},
|
|
{Key: "/1234/dynamic", Value: stringp("garbage")},
|
|
|
}},
|
|
}},
|
|
|
{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
|
- {Key: "/1234/dynamic", Value: stringp(`{"PeerURLs":null}`)},
|
|
|
|
|
|
|
+ {Key: "/1234/dynamic", Value: stringp(`{"peerURLs":null}`)},
|
|
|
}},
|
|
}},
|
|
|
{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
|
- {Key: "/1234/dynamic", Value: stringp(`{"PeerURLs":null}`)},
|
|
|
|
|
|
|
+ {Key: "/1234/dynamic", Value: stringp(`{"peerURLs":null}`)},
|
|
|
{Key: "/1234/strange"},
|
|
{Key: "/1234/strange"},
|
|
|
}},
|
|
}},
|
|
|
{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
|
- {Key: "/1234/dynamic", Value: stringp(`{"PeerURLs":null}`)},
|
|
|
|
|
|
|
+ {Key: "/1234/dynamic", Value: stringp(`{"peerURLs":null}`)},
|
|
|
{Key: "/1234/static", Value: stringp("garbage")},
|
|
{Key: "/1234/static", Value: stringp("garbage")},
|
|
|
}},
|
|
}},
|
|
|
{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
|
- {Key: "/1234/dynamic", Value: stringp(`{"PeerURLs":null}`)},
|
|
|
|
|
- {Key: "/1234/static", Value: stringp(`{"Name":"node1","ClientURLs":null}`)},
|
|
|
|
|
|
|
+ {Key: "/1234/dynamic", Value: stringp(`{"peerURLs":null}`)},
|
|
|
|
|
+ {Key: "/1234/static", Value: stringp(`{"name":"node1","clientURLs":null}`)},
|
|
|
{Key: "/1234/strange"},
|
|
{Key: "/1234/strange"},
|
|
|
}},
|
|
}},
|
|
|
}
|
|
}
|
|
@@ -416,7 +416,7 @@ func TestClusterAddMember(t *testing.T) {
|
|
|
params: []interface{}{
|
|
params: []interface{}{
|
|
|
path.Join(storeMembersPrefix, "1", "raftAttributes"),
|
|
path.Join(storeMembersPrefix, "1", "raftAttributes"),
|
|
|
false,
|
|
false,
|
|
|
- `{"PeerURLs":null}`,
|
|
|
|
|
|
|
+ `{"peerURLs":null}`,
|
|
|
false,
|
|
false,
|
|
|
store.Permanent,
|
|
store.Permanent,
|
|
|
},
|
|
},
|
|
@@ -426,7 +426,7 @@ func TestClusterAddMember(t *testing.T) {
|
|
|
params: []interface{}{
|
|
params: []interface{}{
|
|
|
path.Join(storeMembersPrefix, "1", "attributes"),
|
|
path.Join(storeMembersPrefix, "1", "attributes"),
|
|
|
false,
|
|
false,
|
|
|
- `{"Name":"node1"}`,
|
|
|
|
|
|
|
+ `{"name":"node1"}`,
|
|
|
false,
|
|
false,
|
|
|
store.Permanent,
|
|
store.Permanent,
|
|
|
},
|
|
},
|
|
@@ -519,8 +519,8 @@ func TestClusterRemoveMember(t *testing.T) {
|
|
|
|
|
|
|
|
func TestNodeToMember(t *testing.T) {
|
|
func TestNodeToMember(t *testing.T) {
|
|
|
n := &store.NodeExtern{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
n := &store.NodeExtern{Key: "/1234", Nodes: []*store.NodeExtern{
|
|
|
- {Key: "/1234/attributes", Value: stringp(`{"Name":"node1","ClientURLs":null}`)},
|
|
|
|
|
- {Key: "/1234/raftAttributes", Value: stringp(`{"PeerURLs":null}`)},
|
|
|
|
|
|
|
+ {Key: "/1234/attributes", Value: stringp(`{"name":"node1","clientURLs":null}`)},
|
|
|
|
|
+ {Key: "/1234/raftAttributes", Value: stringp(`{"peerURLs":null}`)},
|
|
|
}}
|
|
}}
|
|
|
wm := &Member{ID: 0x1234, RaftAttributes: RaftAttributes{}, Attributes: Attributes{Name: "node1"}}
|
|
wm := &Member{ID: 0x1234, RaftAttributes: RaftAttributes{}, Attributes: Attributes{Name: "node1"}}
|
|
|
m, err := nodeToMember(n)
|
|
m, err := nodeToMember(n)
|