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
integration test: API allow IPs with leading zeros #107564
Conversation
@aojea: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
fa5f8bc
to
fb1b8d8
Compare
if I use the wrong parser the tests that use that data fails diff --git a/pkg/apis/core/validation/validation.go b/pkg/apis/core/validation/validation.go
index ed7d0ec85c6..e11d43d66e9 100644
--- a/pkg/apis/core/validation/validation.go
+++ b/pkg/apis/core/validation/validation.go
@@ -6097,7 +6097,8 @@ func validateEndpointAddress(address *core.EndpointAddress, fldPath *field.Path)
// - https://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xhtml
func ValidateNonSpecialIP(ipAddress string, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
- ip := netutils.ParseIPSloppy(ipAddress)
+ ip := net.ParseIP(ipAddress)
+ //ip := netutils.ParseIPSloppy(ipAddress)
if ip == nil {
allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "must be a valid IP address"))
return allErrs |
/hold |
fb1b8d8
to
5b8144d
Compare
/hold cancel |
/test pull-kubernetes-conformance-kind-ga-only-parallel what happens with this test, is the second time it fails, is conformance and the PR is totally unrelated |
f71f17c
to
02e68f8
Compare
02e68f8
to
ea13018
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aojea, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind cleanup
What this PR does / why we need it:
Test to verify that IPs with leading zeros remain valid.
IIUIC this exercises
kubernetes/pkg/apis/core/validation/validation.go
Lines 6090 to 6098 in 885961c
that is one of the most used function to validate other fields and should be enough to provide signal.