Skip to content

Commit 3e4e0eb

Browse files
committed
cli/command: cli.initializeFromClient() use client's config for host
Make sure we actually look at the host configured for the client, which should be the source of truth here. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 01fe846 commit 3e4e0eb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cli/command/cli.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func (cli *DockerCli) getInitTimeout() time.Duration {
334334

335335
func (cli *DockerCli) initializeFromClient() {
336336
ctx := context.Background()
337-
if !strings.HasPrefix(cli.DockerEndpoint().Host, "ssh://") {
337+
if !strings.HasPrefix(cli.client.DaemonHost(), "ssh://") {
338338
// @FIXME context.WithTimeout doesn't work with connhelper / ssh connections
339339
// time="2020-04-10T10:16:26Z" level=warning msg="commandConn.CloseWrite: commandconn: failed to wait: signal: killed"
340340
var cancel func()
@@ -429,7 +429,9 @@ func resolveContextName(opts *cliflags.ClientOptions, config *configfile.ConfigF
429429
return DefaultContextName
430430
}
431431

432-
// DockerEndpoint returns the current docker endpoint
432+
// DockerEndpoint returns the current docker endpoint.
433+
//
434+
// TODO(thaJeztah): deprecate this in favor or cli.Client().Host? (unless someone needs the TLSConfig).
433435
func (cli *DockerCli) DockerEndpoint() docker.Endpoint {
434436
return cli.dockerEndpoint
435437
}

0 commit comments

Comments
 (0)