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

Assign ssh.localPort automatically to an available port #285

Merged
merged 2 commits into from
Oct 8, 2021

Conversation

AkihiroSuda
Copy link
Member

  • The hostagent now speaks REST API over ha.sock to provide the port information. See pkg/hostagent/api.
  • For backward compatibility, the "default" instance uses port 60022 by default.

Close #131

@jandubois
Copy link
Member

This PR picks an available TCP port for ssh, but then we assume that the same port is free for UDP (dns) as well.

They used the same port for convenience (so the user doesn't have to configure both), but if we pick a random free one, then we probably should pick the udp port separately, to be sure it is available.

@jandubois
Copy link
Member

The current implementation disables the hostdns lookup because ssh.localPort is 0.

If the port is only determined by the hostagent, then the cidata ISO creation must also be delegated to the hostagent, as it needs to include those port settings, so they are known during cloud-init processing.

@AkihiroSuda
Copy link
Member Author

Fixed to pick up a free UDP DNS port in pkg/hostagent

- The hostagent now speaks REST API over `ha.sock` to provide the port information.
  See `pkg/hostagent/api`.

- For backward compatibility, the "default" instance uses port 60022 by default.

Close issue 131

Signed-off-by: Akihiro Suda <[email protected]>
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda AkihiroSuda merged commit 3ff1a15 into lima-vm:master Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assign ssh.localPort automatically to an available port
2 participants