1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-21 00:03:49 +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" "golang.org/x/crypto/ssh/agent"
) )
const (
DockerAPIVersion = "1.24"
)
func (h *Host) TunnelUp(ctx context.Context, dialerFactory DialerFactory, clusterPrefixPath string, clusterVersion string) error { func (h *Host) TunnelUp(ctx context.Context, dialerFactory DialerFactory, clusterPrefixPath string, clusterVersion string) error {
if h.DClient != nil { if h.DClient != nil {
return nil return nil
@ -34,7 +30,7 @@ func (h *Host) TunnelUp(ctx context.Context, dialerFactory DialerFactory, cluste
// set Docker client // set Docker client
logrus.Debugf("Connecting to Docker API for host [%s]", h.Address) logrus.Debugf("Connecting to Docker API for host [%s]", h.Address)
h.DClient, err = client.NewClientWithOpts( h.DClient, err = client.NewClientWithOpts(
client.WithVersion(DockerAPIVersion), client.WithAPIVersionNegotiation(),
client.WithHTTPClient(httpClient)) client.WithHTTPClient(httpClient))
if err != nil { if err != nil {
return fmt.Errorf("Can't initiate NewClient: %v", err) return fmt.Errorf("Can't initiate NewClient: %v", err)