Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: forward only #800

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,22 +332,12 @@ func (cmd *SSHCmd) forwardPorts(
func (cmd *SSHCmd) startTunnel(ctx context.Context, devPodConfig *config.Config, containerClient *ssh.Client, workspaceName string, ideName string, log log.Logger) error {
// check if we should forward ports
if len(cmd.ForwardPorts) > 0 {
go func() {
err := cmd.forwardPorts(ctx, containerClient, log)
if err != nil {
log.Fatal(err)
}
}()
return cmd.forwardPorts(ctx, containerClient, log)
}

// check if we should reverse forward ports
if len(cmd.ReverseForwardPorts) > 0 && !cmd.GPGAgentForwarding {
go func() {
err := cmd.reverseForwardPorts(ctx, containerClient, log)
if err != nil {
log.Fatal(err)
}
}()
return cmd.reverseForwardPorts(ctx, containerClient, log)
}

// start port-forwarding etc.
Expand All @@ -359,8 +349,8 @@ func (cmd *SSHCmd) startTunnel(ctx context.Context, devPodConfig *config.Config,
writer := log.ErrorStreamOnly().Writer(logrus.InfoLevel, false)
defer writer.Close()

if cmd.GPGAgentForwarding ||
devPodConfig.ContextOption(config.ContextOptionGPGAgentForwarding) == "true" {
// check if we should do gpg agent forwarding
if cmd.GPGAgentForwarding || devPodConfig.ContextOption(config.ContextOptionGPGAgentForwarding) == "true" {
// Check if a forwarding is already enabled and running, in that case
// we skip the forwarding and keep using the original one
if gpg.IsGpgTunnelRunning(cmd.User, ctx, containerClient, log) {
Expand Down
Loading