-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Ipv6 registries #3489
Ipv6 registries #3489
Conversation
aea8f78
to
f963818
Compare
Since this was reported in Kubernetes, I'd prefer the whole ecosystem to be consistent about registries URIs, rather than fix it in Kubernetes only. |
Also wondering if we can use |
I used the regex based on current state and previous PRs, but I rather prefer to validate with the golang stdlib functions if possible, it seems less error prone (unless stdlib changes of course, but this only happened in 1.17 for ipv4 addresses) |
Yes, perhaps there's other reasons for the regexes that I didn't think of, but I saw them, and know that it's easy to make a mistake in regexes (besides them known to be potentially more power-hungry), so if possible, using stdlib, that would be my preference. Of course that's orthogonal to the " the whole ecosystem to be consistent about registries URIs, rather than fix it in Kubernetes only." question For that, given that currently, |
can you please rebase @aojea |
@milosgajdos rebased :) |
it needs other approval, right? |
yeah, pinging @thaJeztah |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
Codecov Report
@@ Coverage Diff @@
## main #3489 +/- ##
=======================================
Coverage 56.58% 56.58%
=======================================
Files 103 103
Lines 7520 7520
=======================================
Hits 4255 4255
Misses 2596 2596
Partials 669 669
Continue to review full report at Codecov.
|
Let me post my comment form #3667 here as well
|
/hold let me work in the stdlib approach, I do prefer that too, this IPv6 regex is not something easier to think about |
ok, it seems I had a misconception, we don't need full validation, as @thaJeztah says we just need a simpler regex I was comparing with golang url.Parse and it doesn't perform validation too |
I think I'm close now, just missing the referenceRegex |
70061f3
to
d897a19
Compare
Ok, this is ready Ipv4 has dots and digits, that are valid repository names, ipv6 has invalid character for repository names. |
/hold cancel |
Current registry reference use a subset of dns and IPv4 addresses to represent a registry domain. Since registries are mostly compatible with rfc3986, that defines the URI generic syntax, this adds support for IPv6 enclosed in squared brackets based on the mentioned rfc. The regexp is only expanded to match on IPv6 addreses enclosed between square brackets, considering only regular IPv6 addresses represented as compressed or uncompressed, excluding special IPv6 address representations. Signed-off-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
@thaJeztah @mikebrow @milosgajdos the current approach is consistent with the golang url.Parse implementation, it just parses without validation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
we should look at changing some of these variables to const
's and see if we need all those utility functions (in favor of just plain string concatenating)
@milosgajdos I'm not familiar with the workflow here, what is missing? |
@aojea sorry for the radio silence on my end. LGTM. |
no worries, thanks so much |
by the way, how often do you use to release, so I can revendor it in kubernetes to fix kubernetes/kubernetes#104491 |
We don't have a regular cadence. |
Fair enough |
registry: support ipv6 addresses
Current registry reference use a subset of dns and IPv4 addresses to
represent a registry domain.
Since registries are mostly compatible with rfc3986, that defines the
URI generic syntax, this adds support for IPv6 enclosed in squared
brackets based on the mentioned rfc, but excluding zone identifiers
as defined by rfc6874 or special addresses such as IPv4-Mapped)
Ref: kubernetes/kubernetes#104491
This builds on top of previous PRs
Kudos to those persons for showing the path