mirror of https://github.com/docker/cli.git
Merge pull request #5345 from thaJeztah/connhelper_cleanups
cli/connhelper: getConnectionHelper: move ssh-option funcs out of closure
This commit is contained in:
commit
35666cf7cb
|
@ -45,14 +45,14 @@ func getConnectionHelper(daemonURL string, sshFlags []string) (*ConnectionHelper
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "ssh host connection is not valid")
|
return nil, errors.Wrap(err, "ssh host connection is not valid")
|
||||||
}
|
}
|
||||||
|
sshFlags = addSSHTimeout(sshFlags)
|
||||||
|
sshFlags = disablePseudoTerminalAllocation(sshFlags)
|
||||||
return &ConnectionHelper{
|
return &ConnectionHelper{
|
||||||
Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||||
args := []string{"docker"}
|
args := []string{"docker"}
|
||||||
if sp.Path != "" {
|
if sp.Path != "" {
|
||||||
args = append(args, "--host", "unix://"+sp.Path)
|
args = append(args, "--host", "unix://"+sp.Path)
|
||||||
}
|
}
|
||||||
sshFlags = addSSHTimeout(sshFlags)
|
|
||||||
sshFlags = disablePseudoTerminalAllocation(sshFlags)
|
|
||||||
args = append(args, "system", "dial-stdio")
|
args = append(args, "system", "dial-stdio")
|
||||||
return commandconn.New(ctx, "ssh", append(sshFlags, sp.Args(args...)...)...)
|
return commandconn.New(ctx, "ssh", append(sshFlags, sp.Args(args...)...)...)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue