@@ -44,8 +44,7 @@ type SSHCmd struct {
44
44
AgentForwarding bool
45
45
GPGAgentForwarding bool
46
46
47
- StartServices bool
48
- ForceGitCredentialForwarding bool
47
+ StartServices bool
49
48
50
49
Proxy bool
51
50
@@ -94,8 +93,6 @@ func NewSSHCmd(flags *flags.GlobalFlags) *cobra.Command {
94
93
sshCmd .Flags ().BoolVar (& cmd .GPGAgentForwarding , "gpg-agent-forwarding" , false , "If true forward the local gpg-agent to the remote machine" )
95
94
sshCmd .Flags ().BoolVar (& cmd .Stdio , "stdio" , false , "If true will tunnel connection through stdout and stdin" )
96
95
sshCmd .Flags ().BoolVar (& cmd .StartServices , "start-services" , true , "If false will not start any port-forwarding or git / docker credentials helper" )
97
- sshCmd .Flags ().BoolVar (& cmd .ForceGitCredentialForwarding , "force-git-credential-forwarding" , false , "Forces git credential forwarding" )
98
- _ = sshCmd .Flags ().MarkHidden ("force-git-credential-forwarding" )
99
96
return sshCmd
100
97
}
101
98
@@ -156,7 +153,7 @@ func (cmd *SSHCmd) startProxyTunnel(
156
153
})
157
154
},
158
155
func (ctx context.Context , containerClient * ssh.Client ) error {
159
- return cmd .startTunnel (ctx , devPodConfig , containerClient , client .Workspace (), client . WorkspaceConfig (). IDE . Name , log )
156
+ return cmd .startTunnel (ctx , devPodConfig , containerClient , client .Workspace (), log )
160
157
},
161
158
)
162
159
}
@@ -234,7 +231,7 @@ func (cmd *SSHCmd) jumpContainer(
234
231
unlockOnce .Do (client .Unlock )
235
232
236
233
// start ssh tunnel
237
- return cmd .startTunnel (ctx , devPodConfig , containerClient , client .Workspace (), client . WorkspaceConfig (). IDE . Name , log )
234
+ return cmd .startTunnel (ctx , devPodConfig , containerClient , client .Workspace (), log )
238
235
})
239
236
}
240
237
@@ -342,7 +339,7 @@ func (cmd *SSHCmd) forwardPorts(
342
339
return <- errChan
343
340
}
344
341
345
- func (cmd * SSHCmd ) startTunnel (ctx context.Context , devPodConfig * config.Config , containerClient * ssh.Client , workspaceName string , ideName string , log log.Logger ) error {
342
+ func (cmd * SSHCmd ) startTunnel (ctx context.Context , devPodConfig * config.Config , containerClient * ssh.Client , workspaceName string , log log.Logger ) error {
346
343
// check if we should forward ports
347
344
if len (cmd .ForwardPorts ) > 0 {
348
345
return cmd .forwardPorts (ctx , containerClient , log )
@@ -355,7 +352,7 @@ func (cmd *SSHCmd) startTunnel(ctx context.Context, devPodConfig *config.Config,
355
352
356
353
// start port-forwarding etc.
357
354
if ! cmd .Proxy && cmd .StartServices {
358
- go cmd .startServices (ctx , devPodConfig , containerClient , ideName , cmd .GitUsername , cmd .GitToken , log )
355
+ go cmd .startServices (ctx , devPodConfig , containerClient , cmd .GitUsername , cmd .GitToken , log )
359
356
}
360
357
361
358
// start ssh
@@ -393,7 +390,7 @@ func (cmd *SSHCmd) startTunnel(ctx context.Context, devPodConfig *config.Config,
393
390
// Traffic is coming in from the outside, we need to forward it to the container
394
391
if cmd .Proxy || cmd .Stdio {
395
392
if cmd .Proxy {
396
- go cmd .startProxyServices (ctx , devPodConfig , containerClient , ideName , log )
393
+ go cmd .startProxyServices (ctx , devPodConfig , containerClient , log )
397
394
}
398
395
399
396
return devssh .Run (ctx , containerClient , command , os .Stdin , os .Stdout , writer )
@@ -416,23 +413,18 @@ func (cmd *SSHCmd) startServices(
416
413
ctx context.Context ,
417
414
devPodConfig * config.Config ,
418
415
containerClient * ssh.Client ,
419
- ideName string ,
420
416
gitUsername ,
421
417
gitToken string ,
422
418
log log.Logger ,
423
419
) {
424
420
if cmd .User != "" {
425
- gitCredentials := ideName != string (config .IDEVSCode )
426
- if cmd .ForceGitCredentialForwarding {
427
- gitCredentials = true
428
- }
429
421
err := tunnel .RunInContainer (
430
422
ctx ,
431
423
devPodConfig ,
432
424
containerClient ,
433
425
cmd .User ,
434
426
false ,
435
- gitCredentials ,
427
+ true ,
436
428
true ,
437
429
nil ,
438
430
gitUsername ,
@@ -449,7 +441,6 @@ func (cmd *SSHCmd) startProxyServices(
449
441
ctx context.Context ,
450
442
devPodConfig * config.Config ,
451
443
containerClient * ssh.Client ,
452
- ideName string ,
453
444
log log.Logger ,
454
445
) {
455
446
gitCredentials := devPodConfig .ContextOption (config .ContextOptionSSHInjectGitCredentials ) == "true"
0 commit comments