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

zarf connect <connect-name> --local-port does not work as expected #2665

Closed
lucasrod16 opened this issue Jun 25, 2024 · 4 comments · Fixed by #2841
Closed

zarf connect <connect-name> --local-port does not work as expected #2665

lucasrod16 opened this issue Jun 25, 2024 · 4 comments · Fixed by #2841
Assignees
Labels
bug 🐞 Something isn't working good first issue 🥇 Good for newcomers

Comments

@lucasrod16
Copy link
Contributor

Environment

App version: v0.35.0

Steps to reproduce

  1. Initialize a cluster

    zarf init --confirm
  2. Attempt to connect to the Zarf registry using a user-specified local port

    zarf connect registry --local-port 8080

Expected result

Zarf forwards traffic from 127.0.0.1:8080 on my local machine to a registry pod in the cluster

Actual Result

Zarf forwards traffic from 127.0.0.1:<randomly-selected-port> on my local machine to a registry pod in the cluster

I expect Zarf to use the --local-port value that I provided instead of a randomly selected port on my machine

Visual Proof (screenshots, videos, text, etc)

Screenshot 2024-06-25 at 2 24 02 PM
Screenshot 2024-06-25 at 2 24 37 PM

Severity/Priority

Low

Additional Context

This was originally reported in #2661

Workaround is to pass Zarf the name of the service to port-forward to and the remote port the registry is accessible at

zarf connect --name zarf-connect-registry --local-port 8080 --remote-port 5000
@chaospuppy
Copy link
Contributor

chaospuppy commented Jul 8, 2024

Is there a reason beyond current need (or lack thereof) that the members of TunnelInfo are currently unexported? My initial thought is to populate these argument values directly into TunnelInfo and pass TunnelInfo to Connect(), which would allow us to carry user settings through to ConnectTunnelInfo here.

@phillebaba
Copy link
Member

There is no specific reason why the properties are not exported, it is more that there is no plan for how an exported API would look. I have wanted to refactor some of the tunneling logic before that.

@chaospuppy
Copy link
Contributor

I've taken a first pass at it, I did end up exporting those properties, so if that isn't desired let me know. I also handle each user input individually to determine if tunnel details should be updated after we determine tunnel info from the supplied target, but I don't know if there's a better way to handle that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working good first issue 🥇 Good for newcomers
Projects
Status: Done
3 participants