re-use remote transports in Peer,Storage,Locker clients (#10788)

use one transport for internode communication
This commit is contained in:
Harshavardhana
2020-11-02 07:43:11 -08:00
committed by GitHub
parent d8e07f2c41
commit 4c773f7068
12 changed files with 31 additions and 67 deletions

View File

@@ -18,7 +18,6 @@ package cmd
import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io"
@@ -224,16 +223,7 @@ func newBootstrapRESTClient(endpoint Endpoint) *bootstrapRESTClient {
Path: bootstrapRESTPath,
}
var tlsConfig *tls.Config
if globalIsSSL {
tlsConfig = &tls.Config{
ServerName: endpoint.Hostname(),
RootCAs: globalRootCAs,
}
}
trFn := newInternodeHTTPTransport(tlsConfig, rest.DefaultTimeout)
restClient := rest.NewClient(serverURL, trFn, newAuthToken)
restClient := rest.NewClient(serverURL, globalInternodeTransport, newAuthToken)
restClient.HealthCheckFn = nil
return &bootstrapRESTClient{endpoint: endpoint, restClient: restClient}