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

integration test: API allow IPs with leading zeros #107564

Merged
merged 1 commit into from Jan 19, 2022

Conversation

aojea
Copy link
Member

@aojea aojea commented Jan 14, 2022

/kind cleanup

What this PR does / why we need it:

Test to verify that IPs with leading zeros remain valid.
IIUIC this exercises

// ValidateNonSpecialIP is used to validate Endpoints, EndpointSlices, and
// external IPs. Specifically, this disallows unspecified and loopback addresses
// are nonsensical and link-local addresses tend to be used for node-centric
// purposes (e.g. metadata service).
//
// IPv6 references
// - https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
// - https://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xhtml
func ValidateNonSpecialIP(ipAddress string, fldPath *field.Path) field.ErrorList {

that is one of the most used function to validate other fields and should be enough to provide signal.

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 14, 2022
@k8s-ci-robot
Copy link
Contributor

@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 triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 14, 2022
@aojea
Copy link
Member Author

aojea commented Jan 14, 2022

/assign @liggitt @sttts

I'll need guidance because is not an area I fully understand

@aojea
Copy link
Member Author

aojea commented Jan 17, 2022

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

@aojea
Copy link
Member Author

aojea commented Jan 17, 2022

/hold
talked with Stefan offline, will add an specific test instead of modifying current data

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 17, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 17, 2022
@aojea aojea changed the title guarantee that IPs with leading zeros are not invalidated integration test: API allow IPs with leading zeros Jan 17, 2022
@aojea
Copy link
Member Author

aojea commented Jan 17, 2022

/hold talked with Stefan offline, will add an specific test instead of modifying current data

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 17, 2022
@aojea
Copy link
Member Author

aojea commented Jan 17, 2022

Kubernetes e2e suite: [sig-node] Pods should run through the lifecycle of Pods and PodStatus [Conformance] expand_more

/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

@aojea aojea force-pushed the funnyips_etcd_data branch 2 times, most recently from f71f17c to 02e68f8 Compare January 17, 2022 21:49
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 17, 2022
@sttts
Copy link
Contributor

sttts commented Jan 18, 2022

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 18, 2022
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 6989e21 into kubernetes:master Jan 19, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants