1
0
mirror of https://github.com/rancher/rke.git synced 2025-04-27 11:21:08 +00:00

use docker client with api negotiation

This commit is contained in:
Kinara Shah 2021-05-27 11:20:11 -07:00
parent bb0d38e303
commit 4c8b149835

View File

@ -18,10 +18,6 @@ import (
"golang.org/x/crypto/ssh/agent"
)
const (
DockerAPIVersion = "1.24"
)
func (h *Host) TunnelUp(ctx context.Context, dialerFactory DialerFactory, clusterPrefixPath string, clusterVersion string) error {
if h.DClient != nil {
return nil
@ -34,7 +30,7 @@ func (h *Host) TunnelUp(ctx context.Context, dialerFactory DialerFactory, cluste
// set Docker client
logrus.Debugf("Connecting to Docker API for host [%s]", h.Address)
h.DClient, err = client.NewClientWithOpts(
client.WithVersion(DockerAPIVersion),
client.WithAPIVersionNegotiation(),
client.WithHTTPClient(httpClient))
if err != nil {
return fmt.Errorf("Can't initiate NewClient: %v", err)