Commit 4eb3a488 authored by Brad Davidson's avatar Brad Davidson Committed by Brad Davidson

Skip setting up client tls when etcd server does not have tls enabled

parent 98036ced
......@@ -608,18 +608,20 @@ func getClientConfig(ctx context.Context, runtime *config.ControlRuntime, endpoi
if len(endpoints) == 0 {
endpoints = getEndpoints(runtime)
}
tlsConfig, err := toTLSConfig(runtime)
if err != nil {
return nil, err
}
return &etcd.Config{
config := &etcd.Config{
Endpoints: endpoints,
TLS: tlsConfig,
Context: ctx,
DialTimeout: defaultDialTimeout,
DialKeepAliveTime: defaultKeepAliveTime,
DialKeepAliveTimeout: defaultKeepAliveTimeout,
}, nil
}
var err error
if strings.HasPrefix(endpoints[0], "https://") {
config.TLS, err = toTLSConfig(runtime)
}
return config, err
}
// getEndpoints returns the endpoints from the runtime config if set, otherwise the default endpoint.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment