mirror of
https://github.com/rancher/rke.git
synced 2025-09-17 07:30:01 +00:00
Merge pull request #2553 from kinarashah/dockerclient
use docker client with api negotiation
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user