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

Split regex for map and set elements to enable elements with colon. #6

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

npinaeva
Copy link
Member

ipv6 contains colons, which is also a separator between keys and values for map element, and it was used before in a regex, which prevented ipv6 ips from being properly parsed as set elements.

ipv6 dump comes from https://github.com/kubernetes/kubernetes/blob/ec58e1f2fc3b56aa1e9c333598fdfab8d5aa66d1/pkg/proxy/nftables/proxier_test.go#L919-L925

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 22, 2024
fake_test.go Outdated
ipFamily Family
}

tc1 := tc{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you rewrite this to be more like the "standard" unit test style with

	for _, tc := range []struct {
		name string
		...
	}{
	...

eg like most of the ones in nftables_test.go. (The existing tests in fake_test.go weren't written that way because they aren't doing a series of independent tests, they're doing a single test with many parts.)

fake_test.go Outdated
Comment on lines 569 to 570
ipFamily: IPv4Family,
dump: `
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(should use the same field ordering here and in the struct definition...)

ipv6 contains colons, which is also a separator between keys and values
for map element, and it was used before in a regex, which prevented
ipv6 ips from being properly parsed as set elements.

Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
@danwinship
Copy link
Collaborator

/lgtm
/approve

You can test your k8s branch against this by revendoring the specific git SHA rather than a tag name. (Or just copy the fixes into vendor/ by hand...) Once you're sure everything is working there I can tag another release here.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship, npinaeva

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 28, 2024
@k8s-ci-robot k8s-ci-robot merged commit 78f68d9 into kubernetes-sigs:master Feb 28, 2024
5 checks passed
@npinaeva npinaeva deleted the parse-dump branch February 28, 2024 17:31
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants