Skip to content

Commit

Permalink
Revert "cli/command: cli.initializeFromClient() use client's config f…
Browse files Browse the repository at this point in the history
…or host"

This reverts commit 459c564.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Nov 4, 2022
1 parent 598e509 commit 93a39e0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cli/command/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func (cli *DockerCli) getInitTimeout() time.Duration {

func (cli *DockerCli) initializeFromClient() {
ctx := context.Background()
if !strings.HasPrefix(cli.client.DaemonHost(), "ssh://") {
if !strings.HasPrefix(cli.DockerEndpoint().Host, "ssh://") {
// @FIXME context.WithTimeout doesn't work with connhelper / ssh connections
// time="2020-04-10T10:16:26Z" level=warning msg="commandConn.CloseWrite: commandconn: failed to wait: signal: killed"
var cancel func()
Expand Down Expand Up @@ -374,9 +374,7 @@ func (cli *DockerCli) CurrentContext() string {
return resolveContextName(cli.options, cli.configFile)
}

// DockerEndpoint returns the current docker endpoint.
//
// TODO(thaJeztah): deprecate this in favor or cli.Client().Host? (unless someone needs the TLSConfig).
// DockerEndpoint returns the current docker endpoint
func (cli *DockerCli) DockerEndpoint() docker.Endpoint {
if err := cli.initialize(); err != nil {
// Note that we're not terminating here, as this function may be used
Expand Down

0 comments on commit 93a39e0

Please sign in to comment.