Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etcd: add grpc.WithBlock to client config #8205

Merged
merged 1 commit into from
Jun 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions go/vt/topo/etcd2topo/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import (
"strings"
"time"

"google.golang.org/grpc"

clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/pkg/v3/tlsutil"

Expand Down Expand Up @@ -116,11 +118,13 @@ func newTLSConfig(certPath, keyPath, caPath string) (*tls.Config, error) {
return tlscfg, nil
}

// NewServerWithOpts creates a new server with the provided TLS options
func NewServerWithOpts(serverAddr, root, certPath, keyPath, caPath string) (*Server, error) {
// TODO: Rename this to NewServer and change NewServer to a name that signifies it uses the process-wide TLS settings.
config := clientv3.Config{
Endpoints: strings.Split(serverAddr, ","),
DialTimeout: 5 * time.Second,
DialOptions: []grpc.DialOption{grpc.WithBlock()},
}

tlscfg, err := newTLSConfig(certPath, keyPath, caPath)
Expand Down