Skip to content

Commit 7d74402

Browse files
committed
Pass handover timeout to the ssh client ProxyCommand
1 parent 7478778 commit 7d74402

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/ssh/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func RunClient(ctx context.Context, client *databricks.WorkspaceClient, opts Cli
112112
return startSSHProxy(ctx, client, opts.ClusterID, serverPort, opts.HandoverTimeout)
113113
} else {
114114
cmdio.LogString(ctx, fmt.Sprintf("Additional SSH arguments: %v", opts.AdditionalArgs))
115-
return spawnSSHClient(ctx, opts.ClusterID, userName, privateKeyPath, serverPort, opts.AdditionalArgs)
115+
return spawnSSHClient(ctx, opts.ClusterID, userName, privateKeyPath, serverPort, opts.HandoverTimeout, opts.AdditionalArgs)
116116
}
117117
}
118118

@@ -236,14 +236,14 @@ func submitSSHTunnelJob(ctx context.Context, client *databricks.WorkspaceClient,
236236
return runResult.Response.RunId, nil
237237
}
238238

239-
func spawnSSHClient(ctx context.Context, clusterID, userName, privateKeyPath string, serverPort int, additionalArgs []string) error {
239+
func spawnSSHClient(ctx context.Context, clusterID, userName, privateKeyPath string, serverPort int, handoverTimeout time.Duration, additionalArgs []string) error {
240240
executablePath, err := os.Executable()
241241
if err != nil {
242242
return fmt.Errorf("failed to get current executable path: %w", err)
243243
}
244244

245-
proxyCommand := fmt.Sprintf("%s ssh connect --proxy --cluster=%s --metadata=%s,%d",
246-
executablePath, clusterID, userName, serverPort)
245+
proxyCommand := fmt.Sprintf("%s ssh connect --proxy --cluster=%s --handover-timeout=%s --metadata=%s,%d",
246+
executablePath, clusterID, handoverTimeout.String(), userName, serverPort)
247247

248248
sshArgs := []string{
249249
"-l", userName,

0 commit comments

Comments
 (0)