Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Add missing ssh/scp extra args support #11

Merged
merged 1 commit into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions cmd/scp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 6 additions & 3 deletions cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")))

Expand Down
9 changes: 6 additions & 3 deletions cmd/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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")))

Expand Down