Skip to content

Commit 9ec2335

Browse files
authored
Merge pull request #427 from reubenmiller/fix-remoteaccess-ssh
fix: remoteaccess connect ssh handling of empty port-forwarding options
2 parents ffce564 + 3a94eb7 commit 9ec2335

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ tasks:
193193
- goreleaser build --clean --snapshot --single-target --id {{.OS_NAME}} {{.CLI_ARGS}}
194194
- rm -f .bin/c8y
195195
- mkdir -p .bin
196-
- cp dist/{{.OS_NAME}}_{{OS}}_{{.ARCH_NAME}}/bin/c8y .bin/c8y
196+
- cp dist/{{.OS_NAME}}_{{OS}}_{{.ARCH_NAME}}*/bin/c8y .bin/c8y
197197

198198
generate:
199199
desc: Generate the cli code

pkg/cmd/remoteaccess/connect/ssh/ssh.manual.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ func NewCmdSSH(f *cmdutil.Factory) *CmdSSH {
107107
func (n *CmdSSH) GetPortForwarding() string {
108108
// convenience functions to mirror docker port mapping options
109109
portMapping := n.portForwarding
110+
111+
if portMapping == "" {
112+
return portMapping
113+
}
114+
110115
portForwardingParts := strings.Split(portMapping, ":")
111116
switch len(portForwardingParts) {
112117
case 1:

0 commit comments

Comments
 (0)