Allow multiple etcd hosts to be specified in db.etcd.host.

This commit is contained in:
elbandi 2023-09-09 00:11:46 +02:00
parent 72a36da9c6
commit 3d48dbdd55
No known key found for this signature in database
GPG key ID: F47849B750B9FA84
2 changed files with 4 additions and 2 deletions

View file

@ -8,6 +8,7 @@ import (
"fmt"
"io"
"runtime"
"strings"
"sync"
"time"
@ -138,7 +139,7 @@ func NewEtcdClient(ctx context.Context, cfg Config) (*clientv3.Client,
context.Context, func(), error) {
clientCfg := clientv3.Config{
Endpoints: []string{cfg.Host},
Endpoints: strings.Split(cfg.Host, ","),
DialTimeout: etcdConnectionTimeout,
Username: cfg.User,
Password: cfg.Pass,

View file

@ -5,6 +5,7 @@ package etcd
import (
"context"
"strings"
"testing"
"time"
@ -49,7 +50,7 @@ func NewEtcdTestFixture(t *testing.T) *EtcdTestFixture {
t.Cleanup(etcdCleanup)
cli, err := clientv3.New(clientv3.Config{
Endpoints: []string{config.Host},
Endpoints: strings.Split(config.Host, ","),
Username: config.User,
Password: config.Pass,
})