@@ -215,7 +215,14 @@ func (cmd *UpCmd) Run(
215215 setupGPGAgentForwarding := cmd .GPGAgentForwarding || devPodConfig .ContextOption (config .ContextOptionGPGAgentForwarding ) == "true"
216216 sshConfigIncludePath := devPodConfig .ContextOption (config .ContextOptionSSHConfigIncludePath )
217217
218- err = configureSSH (client , cmd .SSHConfigPath , sshConfigIncludePath , user , workdir , setupGPGAgentForwarding , devPodHome )
218+ err = configureSSH (client , configureSSHParams {
219+ sshConfigPath : cmd .SSHConfigPath ,
220+ sshConfigIncludePath : sshConfigIncludePath ,
221+ user : user ,
222+ workdir : workdir ,
223+ gpgagent : setupGPGAgentForwarding ,
224+ devPodHome : devPodHome ,
225+ })
219226 if err != nil {
220227 return err
221228 }
@@ -1003,13 +1010,23 @@ func startBrowserTunnel(
10031010 return nil
10041011}
10051012
1006- func configureSSH (client client2.BaseWorkspaceClient , sshConfigPath , sshConfigIncludePath , user , workdir string , gpgagent bool , devPodHome string ) error {
1007- path , err := devssh .ResolveSSHConfigPath (sshConfigPath )
1013+ type configureSSHParams struct {
1014+ sshConfigPath string
1015+ sshConfigIncludePath string
1016+ user string
1017+ workdir string
1018+ gpgagent bool
1019+ devPodHome string
1020+ }
1021+
1022+ func configureSSH (client client2.BaseWorkspaceClient , params configureSSHParams ) error {
1023+ path , err := devssh .ResolveSSHConfigPath (params .sshConfigPath )
10081024 if err != nil {
10091025 return fmt .Errorf ("invalid ssh config path %w" , err )
10101026 }
1011- sshConfigPath = path
1027+ sshConfigPath : = path
10121028
1029+ sshConfigIncludePath := params .sshConfigIncludePath
10131030 if sshConfigIncludePath != "" {
10141031 includePath , err := devssh .ResolveSSHConfigPath (sshConfigIncludePath )
10151032 if err != nil {
@@ -1018,17 +1035,17 @@ func configureSSH(client client2.BaseWorkspaceClient, sshConfigPath, sshConfigIn
10181035 sshConfigIncludePath = includePath
10191036 }
10201037
1021- err = devssh .ConfigureSSHConfig (
1022- sshConfigPath ,
1023- sshConfigIncludePath ,
1024- client .Context (),
1025- client .Workspace (),
1026- user ,
1027- workdir ,
1028- gpgagent ,
1029- devPodHome ,
1030- log .Default ,
1031- )
1038+ err = devssh .ConfigureSSHConfig (devssh. SSHConfigParams {
1039+ SSHConfigPath : sshConfigPath ,
1040+ SSHConfigIncludePath : sshConfigIncludePath ,
1041+ Context : client .Context (),
1042+ Workspace : client .Workspace (),
1043+ User : params . user ,
1044+ Workdir : params . workdir ,
1045+ GPGAgent : params . gpgagent ,
1046+ DevPodHome : params . devPodHome ,
1047+ Log : log .Default ,
1048+ } )
10321049 if err != nil {
10331050 return err
10341051 }
@@ -1450,21 +1467,23 @@ func (cmd *UpCmd) prepareClient(ctx context.Context, devPodConfig *config.Config
14501467 client , err := workspace2 .Resolve (
14511468 ctx ,
14521469 devPodConfig ,
1453- cmd .IDE ,
1454- cmd .IDEOptions ,
1455- args ,
1456- cmd .ID ,
1457- cmd .Machine ,
1458- cmd .ProviderOptions ,
1459- cmd .Reconfigure ,
1460- cmd .DevContainerImage ,
1461- cmd .DevContainerPath ,
1462- cmd .SSHConfigPath ,
1463- sshConfigIncludePath ,
1464- source ,
1465- cmd .UID ,
1466- true ,
1467- cmd .Owner ,
1470+ workspace2.ResolveParams {
1471+ IDE : cmd .IDE ,
1472+ IDEOptions : cmd .IDEOptions ,
1473+ Args : args ,
1474+ DesiredID : cmd .ID ,
1475+ DesiredMachine : cmd .Machine ,
1476+ ProviderUserOptions : cmd .ProviderOptions ,
1477+ ReconfigureProvider : cmd .Reconfigure ,
1478+ DevContainerImage : cmd .DevContainerImage ,
1479+ DevContainerPath : cmd .DevContainerPath ,
1480+ SSHConfigPath : cmd .SSHConfigPath ,
1481+ SSHConfigIncludePath : sshConfigIncludePath ,
1482+ Source : source ,
1483+ UID : cmd .UID ,
1484+ ChangeLastUsed : true ,
1485+ Owner : cmd .Owner ,
1486+ },
14681487 logger ,
14691488 )
14701489 if err != nil {
0 commit comments