Skip to content

Commit

Permalink
Merge pull request #427 from reubenmiller/fix-remoteaccess-ssh
Browse files Browse the repository at this point in the history
fix: remoteaccess connect ssh handling of empty port-forwarding options
  • Loading branch information
reubenmiller authored Jan 29, 2025
2 parents ffce564 + 3a94eb7 commit 9ec2335
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ tasks:
- goreleaser build --clean --snapshot --single-target --id {{.OS_NAME}} {{.CLI_ARGS}}
- rm -f .bin/c8y
- mkdir -p .bin
- cp dist/{{.OS_NAME}}_{{OS}}_{{.ARCH_NAME}}/bin/c8y .bin/c8y
- cp dist/{{.OS_NAME}}_{{OS}}_{{.ARCH_NAME}}*/bin/c8y .bin/c8y

generate:
desc: Generate the cli code
Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/remoteaccess/connect/ssh/ssh.manual.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ func NewCmdSSH(f *cmdutil.Factory) *CmdSSH {
func (n *CmdSSH) GetPortForwarding() string {
// convenience functions to mirror docker port mapping options
portMapping := n.portForwarding

if portMapping == "" {
return portMapping
}

portForwardingParts := strings.Split(portMapping, ":")
switch len(portForwardingParts) {
case 1:
Expand Down

0 comments on commit 9ec2335

Please sign in to comment.