-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
fake_test.go
Outdated
ipFamily Family | ||
} | ||
|
||
tc1 := tc{ |
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.
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
ipFamily: IPv4Family, | ||
dump: ` |
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.
(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>
/lgtm 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 |
[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 |
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