From 43dd6ea46417c76750c6be8d9159e650783d41d1 Mon Sep 17 00:00:00 2001 From: Matthew MacLeod Date: Mon, 18 Nov 2024 15:26:37 +0000 Subject: [PATCH] cli/connhelper: raise remote binary evaluation out of dialer context Signed-off-by: Matthew MacLeod --- cli/connhelper/connhelper.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/connhelper/connhelper.go b/cli/connhelper/connhelper.go index e93bf5f61a..309320889f 100644 --- a/cli/connhelper/connhelper.go +++ b/cli/connhelper/connhelper.go @@ -54,9 +54,10 @@ func getConnectionHelper(daemonURL string, sshFlags []string) (*ConnectionHelper } sshFlags = addSSHTimeout(sshFlags) sshFlags = disablePseudoTerminalAllocation(sshFlags) + remoteDockerBinary := dockerSSHRemoteBinary() return &ConnectionHelper{ Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { - args := []string{dockerSSHRemoteBinary()} + args := []string{remoteDockerBinary} if sp.Path != "" { args = append(args, "--host", "unix://"+sp.Path) }