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

Cannot join on IPv6 address #4614

Open
KaiSforza opened this issue Aug 9, 2024 · 0 comments
Open

Cannot join on IPv6 address #4614

KaiSforza opened this issue Aug 9, 2024 · 0 comments

Comments

@KaiSforza
Copy link

Summary

Using an IPv6 address as the join connection IP address causes the address to fail the get_valid_connection_parts function, since it spljits on :, which are separators for IPv6 addresses. There is already an ipaddress.ip_address call that should validate everything, I don't think we need the len(master_ep) != 2, and should probably do a .rsplit(":", 1) here instead.

What Should Happen Instead?

I should be able to type

microk8s join add0:a:1:25000/token/fp
# or
microk8s join [add0:a:1]:25000/token/fp

and join the master at add0:a:1.

Reproduction Steps

  1. Create a microk8s node with an IPv6 address
  2. Type microk8s add-node
  3. Copy one of the lines with the IPv6 address on it
  4. See Invalid connection: Expected format: <master_IP>:<master_PORT>/<token>[/<fingerprint>]

Can you suggest a fix?

Remove the check for if len(master_ep) != 2 here and edit https://github.com/canonical/microk8s/blob/master/scripts/wrappers/common/cluster/utils.py#L573 to do an ...rsplit(":", 1) to just split on the one side and get the IP separately from the port.

Probably also need to add a strip("[]") to remove the brackets from an IPv6 address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant