mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-21 23:16:34 +02:00
Update for changed etcd config API.
This commit is contained in:
parent
186c7bf052
commit
73808f5a68
|
@ -79,12 +79,12 @@ func NewEtcdForTest(t *testing.T) *embed.Etcd {
|
|||
var etcd *embed.Etcd
|
||||
for port := 50000; port < 50100; port++ {
|
||||
u.Host = net.JoinHostPort("localhost", strconv.Itoa(port))
|
||||
cfg.LCUrls = []url.URL{*u}
|
||||
cfg.ACUrls = []url.URL{*u}
|
||||
cfg.ListenClientUrls = []url.URL{*u}
|
||||
cfg.AdvertiseClientUrls = []url.URL{*u}
|
||||
peerListener := u
|
||||
peerListener.Host = net.JoinHostPort("localhost", strconv.Itoa(port+1))
|
||||
cfg.LPUrls = []url.URL{*peerListener}
|
||||
cfg.APUrls = []url.URL{*peerListener}
|
||||
cfg.ListenPeerUrls = []url.URL{*peerListener}
|
||||
cfg.AdvertisePeerUrls = []url.URL{*peerListener}
|
||||
cfg.InitialCluster = "default=" + peerListener.String()
|
||||
etcd, err = embed.StartEtcd(cfg)
|
||||
if isErrorAddressAlreadyInUse(err) {
|
||||
|
@ -111,7 +111,7 @@ func NewEtcdClientForTest(t *testing.T) (*embed.Etcd, *EtcdClient) {
|
|||
etcd := NewEtcdForTest(t)
|
||||
|
||||
config := goconf.NewConfigFile()
|
||||
config.AddOption("etcd", "endpoints", etcd.Config().LCUrls[0].String())
|
||||
config.AddOption("etcd", "endpoints", etcd.Config().ListenClientUrls[0].String())
|
||||
|
||||
client, err := NewEtcdClient(config, "")
|
||||
if err != nil {
|
||||
|
|
|
@ -58,7 +58,7 @@ func NewGrpcClientsForTest(t *testing.T, addr string) *GrpcClients {
|
|||
|
||||
func NewGrpcClientsWithEtcdForTest(t *testing.T, etcd *embed.Etcd) *GrpcClients {
|
||||
config := goconf.NewConfigFile()
|
||||
config.AddOption("etcd", "endpoints", etcd.Config().LCUrls[0].String())
|
||||
config.AddOption("etcd", "endpoints", etcd.Config().ListenClientUrls[0].String())
|
||||
|
||||
config.AddOption("grpc", "targettype", "etcd")
|
||||
config.AddOption("grpc", "targetprefix", "/grpctargets")
|
||||
|
|
|
@ -79,7 +79,7 @@ func newEtcdForTesting(t *testing.T) *embed.Etcd {
|
|||
var etcd *embed.Etcd
|
||||
for port := 50000; port < 50100; port++ {
|
||||
u.Host = net.JoinHostPort("localhost", strconv.Itoa(port))
|
||||
cfg.LCUrls = []url.URL{*u}
|
||||
cfg.ListenClientUrls = []url.URL{*u}
|
||||
etcd, err = embed.StartEtcd(cfg)
|
||||
if isErrorAddressAlreadyInUse(err) {
|
||||
continue
|
||||
|
@ -105,7 +105,7 @@ func newTokensEtcdForTesting(t *testing.T) (*tokensEtcd, *embed.Etcd) {
|
|||
etcd := newEtcdForTesting(t)
|
||||
|
||||
cfg := goconf.NewConfigFile()
|
||||
cfg.AddOption("etcd", "endpoints", etcd.Config().LCUrls[0].String())
|
||||
cfg.AddOption("etcd", "endpoints", etcd.Config().ListenClientUrls[0].String())
|
||||
cfg.AddOption("tokens", "keyformat", "/%s, /testing/%s/key")
|
||||
|
||||
tokens, err := NewProxyTokensEtcd(cfg)
|
||||
|
|
Loading…
Reference in a new issue