Commit 827c669
committed
fix: properly format IPv6 addresses in server URLs
When provisioning nodes with IPv6 control plane endpoints, the bootstrap
provider was generating invalid server URLs in the RKE2 configuration.
Invalid format: https://fd12:3456:890b::250:6443
Correct format: https://[fd12:3456:890b::250]:6443
This fix uses the standard library net.JoinHostPort function which
properly handles IPv6 bracket notation per RFC 3986. The function
automatically wraps IPv6 addresses in brackets while leaving IPv4
addresses and hostnames unchanged.
The fix is applied to all three server URL generation points:
- Init control plane config
- Join control plane config
- Worker node config
This eliminates the need for sed workarounds in user manifests.
Fixes: Invalid IPv6 URL parsing in RKE2 bootstrap config
Signed-off-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent ff6401d commit 827c669
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | | - | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
469 | 470 | | |
470 | 471 | | |
471 | 472 | | |
472 | | - | |
| 473 | + | |
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
| |||
713 | 714 | | |
714 | 715 | | |
715 | 716 | | |
716 | | - | |
| 717 | + | |
717 | 718 | | |
718 | 719 | | |
719 | 720 | | |
| |||
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
866 | | - | |
| 867 | + | |
867 | 868 | | |
868 | 869 | | |
869 | 870 | | |
| |||
0 commit comments