From edd74361d2eb85b817990d353074ca6fe916b3a9 Mon Sep 17 00:00:00 2001 From: Marcin Matlaszek Date: Thu, 14 Mar 2019 13:17:35 +0100 Subject: [PATCH] Add missing ssh/scp extra args support --- cmd/scp.go | 2 ++ cmd/ssh.go | 9 ++++++--- cmd/tunnel.go | 9 ++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cmd/scp.go b/cmd/scp.go index 9caaf8d..3033169 100644 --- a/cmd/scp.go +++ b/cmd/scp.go @@ -68,6 +68,8 @@ func scpCmdFunc(cmd *cobra.Command, args []string) { cmd.Annotations["local_path"], } baseCommand := []string{config.GlobalConfig.ScpBinary} + baseCommand = append(baseCommand, config.GlobalConfig.ScpExtraParams...) + if checkIfRemotePath(cmd.Annotations["copy_from"]) { baseCommand = append(baseCommand, command.CopyFromRemoteCmd()...) } else { diff --git a/cmd/ssh.go b/cmd/ssh.go index f307282..65b7592 100644 --- a/cmd/ssh.go +++ b/cmd/ssh.go @@ -49,14 +49,17 @@ func sshCmdFunc(cmd *cobra.Command, args []string) { os.Exit(1) } - sshCommandWithArgs := []string{ - config.GlobalConfig.SSHBinary, + baseCommand := []string{config.GlobalConfig.SSHBinary} + baseCommand = append(baseCommand, config.GlobalConfig.SSHExtraParams...) + + sshCommandWithArgs := append(baseCommand, []string{ fmt.Sprintf( "%s@%s", config.GlobalConfig.LoginUsername, resource.ConnectIdentifier(config.GlobalConfig.UsePrivateNetwork, config.GlobalConfig.UseDNS), ), - } + }...) + color.PrintGreen(fmt.Sprintf("Logging into %s (%s)\n", resource.Name(), resource.GetTag("environment"))) diff --git a/cmd/tunnel.go b/cmd/tunnel.go index 5506933..1ffb849 100644 --- a/cmd/tunnel.go +++ b/cmd/tunnel.go @@ -56,8 +56,10 @@ func tunnelCmdFunc(cmd *cobra.Command, args []string) { os.Exit(1) } - tunnelCommand := []string{ - config.GlobalConfig.SSHBinary, + baseCommand := []string{config.GlobalConfig.SSHBinary} + baseCommand = append(baseCommand, config.GlobalConfig.SSHExtraParams...) + + tunnelCommand := append(baseCommand, []string{ fmt.Sprintf( "%s@%s", config.GlobalConfig.LoginUsername, @@ -70,7 +72,8 @@ func tunnelCmdFunc(cmd *cobra.Command, args []string) { cmd.Annotations["local_bind_address"], cmd.Annotations["remote_bind_address"], ), - } + }...) + color.PrintGreen(fmt.Sprintf("Creating ssh tunnel to %s (%s)\n", resource.Name(), resource.GetTag("environment")))