mirror of https://github.com/status-im/consul.git
Merge pull request #2316 from hashicorp/b-operator
Copies the member data instead of referencing by pointer.
This commit is contained in:
commit
d1a76b363b
|
@ -38,7 +38,7 @@ func (op *Operator) RaftGetConfiguration(args *structs.DCSpecificRequest, reply
|
||||||
}
|
}
|
||||||
|
|
||||||
// Index the Consul information about the servers.
|
// Index the Consul information about the servers.
|
||||||
serverMap := make(map[raft.ServerAddress]*serf.Member)
|
serverMap := make(map[raft.ServerAddress]serf.Member)
|
||||||
for _, member := range op.srv.serfLAN.Members() {
|
for _, member := range op.srv.serfLAN.Members() {
|
||||||
valid, parts := agent.IsConsulServer(member)
|
valid, parts := agent.IsConsulServer(member)
|
||||||
if !valid {
|
if !valid {
|
||||||
|
@ -46,7 +46,7 @@ func (op *Operator) RaftGetConfiguration(args *structs.DCSpecificRequest, reply
|
||||||
}
|
}
|
||||||
|
|
||||||
addr := (&net.TCPAddr{IP: member.Addr, Port: parts.Port}).String()
|
addr := (&net.TCPAddr{IP: member.Addr, Port: parts.Port}).String()
|
||||||
serverMap[raft.ServerAddress(addr)] = &member
|
serverMap[raft.ServerAddress(addr)] = member
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill out the reply.
|
// Fill out the reply.
|
||||||
|
|
Loading…
Reference in New Issue