You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Create a microk8s node with an IPv6 address
Type microk8s add-node
Copy one of the lines with the IPv6 address on it
See Invalid connection: Expected format: <master_IP>:<master_PORT>/<token>[/<fingerprint>]
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 anipaddress.ip_address
call that should validate everything, I don't think we need thelen(master_ep) != 2
, and should probably do a.rsplit(":", 1)
here instead.What Should Happen Instead?
I should be able to type
and join the master at
add0:a:1
.Reproduction Steps
microk8s add-node
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.The text was updated successfully, but these errors were encountered: