@@ -213,8 +213,9 @@ func (cmd *UpCmd) Run(
213213 devPodHome = envDevPodHome
214214 }
215215 setupGPGAgentForwarding := cmd .GPGAgentForwarding || devPodConfig .ContextOption (config .ContextOptionGPGAgentForwarding ) == "true"
216+ sshConfigIncludePath := devPodConfig .ContextOption (config .ContextOptionSSHConfigIncludePath )
216217
217- err = configureSSH (client , cmd .SSHConfigPath , user , workdir , setupGPGAgentForwarding , devPodHome )
218+ err = configureSSH (client , cmd .SSHConfigPath , sshConfigIncludePath , user , workdir , setupGPGAgentForwarding , devPodHome )
218219 if err != nil {
219220 return err
220221 }
@@ -850,7 +851,7 @@ func setupBackhaul(client client2.BaseWorkspaceClient, authSockId string, log lo
850851 return err
851852 }
852853
853- remoteUser , err := devssh .GetUser (client .WorkspaceConfig ().ID , client .WorkspaceConfig ().SSHConfigPath )
854+ remoteUser , err := devssh .GetUser (client .WorkspaceConfig ().ID , client .WorkspaceConfig ().SSHConfigPath , client . WorkspaceConfig (). SSHConfigIncludePath )
854855 if err != nil {
855856 remoteUser = "root"
856857 }
@@ -1002,15 +1003,24 @@ func startBrowserTunnel(
10021003 return nil
10031004}
10041005
1005- func configureSSH (client client2.BaseWorkspaceClient , sshConfigPath , user , workdir string , gpgagent bool , devPodHome string ) error {
1006+ func configureSSH (client client2.BaseWorkspaceClient , sshConfigPath , sshConfigIncludePath , user , workdir string , gpgagent bool , devPodHome string ) error {
10061007 path , err := devssh .ResolveSSHConfigPath (sshConfigPath )
10071008 if err != nil {
10081009 return fmt .Errorf ("invalid ssh config path %w" , err )
10091010 }
10101011 sshConfigPath = path
10111012
1013+ if sshConfigIncludePath != "" {
1014+ includePath , err := devssh .ResolveSSHConfigPath (sshConfigIncludePath )
1015+ if err != nil {
1016+ return fmt .Errorf ("invalid ssh config include path %w" , err )
1017+ }
1018+ sshConfigIncludePath = includePath
1019+ }
1020+
10121021 err = devssh .ConfigureSSHConfig (
10131022 sshConfigPath ,
1023+ sshConfigIncludePath ,
10141024 client .Context (),
10151025 client .Workspace (),
10161026 user ,
@@ -1195,7 +1205,7 @@ func buildDotCmd(devPodConfig *config.Config, dotfilesRepo, dotfilesScript strin
11951205 sshCmd = append (sshCmd , "--send-env" , envKey )
11961206 }
11971207
1198- remoteUser , err := devssh .GetUser (client .WorkspaceConfig ().ID , client .WorkspaceConfig ().SSHConfigPath )
1208+ remoteUser , err := devssh .GetUser (client .WorkspaceConfig ().ID , client .WorkspaceConfig ().SSHConfigPath , client . WorkspaceConfig (). SSHConfigIncludePath )
11991209 if err != nil {
12001210 remoteUser = "root"
12011211 }
@@ -1254,7 +1264,7 @@ func setupGitSSHSignature(signingKey string, client client2.BaseWorkspaceClient,
12541264 return err
12551265 }
12561266
1257- remoteUser , err := devssh .GetUser (client .WorkspaceConfig ().ID , client .WorkspaceConfig ().SSHConfigPath )
1267+ remoteUser , err := devssh .GetUser (client .WorkspaceConfig ().ID , client .WorkspaceConfig ().SSHConfigPath , client . WorkspaceConfig (). SSHConfigIncludePath )
12581268 if err != nil {
12591269 remoteUser = "root"
12601270 }
@@ -1288,7 +1298,7 @@ func performGpgForwarding(
12881298 return err
12891299 }
12901300
1291- remoteUser , err := devssh .GetUser (client .WorkspaceConfig ().ID , client .WorkspaceConfig ().SSHConfigPath )
1301+ remoteUser , err := devssh .GetUser (client .WorkspaceConfig ().ID , client .WorkspaceConfig ().SSHConfigPath , client . WorkspaceConfig (). SSHConfigIncludePath )
12921302 if err != nil {
12931303 remoteUser = "root"
12941304 }
@@ -1435,6 +1445,7 @@ func (cmd *UpCmd) prepareClient(ctx context.Context, devPodConfig *config.Config
14351445 if cmd .SSHConfigPath == "" {
14361446 cmd .SSHConfigPath = devPodConfig .ContextOption (config .ContextOptionSSHConfigPath )
14371447 }
1448+ sshConfigIncludePath := devPodConfig .ContextOption (config .ContextOptionSSHConfigIncludePath )
14381449
14391450 client , err := workspace2 .Resolve (
14401451 ctx ,
@@ -1449,6 +1460,7 @@ func (cmd *UpCmd) prepareClient(ctx context.Context, devPodConfig *config.Config
14491460 cmd .DevContainerImage ,
14501461 cmd .DevContainerPath ,
14511462 cmd .SSHConfigPath ,
1463+ sshConfigIncludePath ,
14521464 source ,
14531465 cmd .UID ,
14541466 true ,
0 commit comments