-
Notifications
You must be signed in to change notification settings - Fork 192
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
connectivity test: Fix flow validation for nodeport service tests #2103
Draft
jrajahalme
wants to merge
2
commits into
main
Choose a base branch
from
fix-nodeport-flow-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jrajahalme
force-pushed
the
fix-nodeport-flow-validation
branch
from
November 10, 2023 09:50
d64c5ae
to
76e215c
Compare
net.Addr.To16 succeeds for both IPv4 and IPv6 addresses, so it alone can not be used to test if an address is an IPv6 address. Also, if any family is allowed, nodeportService.Address should still return address of type corev1.NodeInternalIP. Generalize ToNodeportService by taking []corev1.NodeAddress as an argument, so that it can be used from more test cases. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
jrajahalme
force-pushed
the
fix-nodeport-flow-validation
branch
from
November 10, 2023 12:28
76e215c
to
96f73d4
Compare
christarazi
approved these changes
Nov 10, 2023
jrajahalme
force-pushed
the
fix-nodeport-flow-validation
branch
from
November 14, 2023 10:20
96f73d4
to
92c66a0
Compare
Added back the use of |
Use TestPeer of type NodeportService to simplify special casing for nodeport tests. Pass the ip family of the current node address to t.NewAction, so that the address of the correct family is used in flow validation. This fixes the bug where IPv4 address is being used to validate an IPv6 flow like below: [=] Test [no-policies-extra] [.] Action [no-policies-extra/pod-to-remote-nodeport/curl-0: cilium-test/client2-646b88fb9b-w5rck (10.244.1.113) -> cilium-test/echo-other-node (echo-other-node:8080)] π Following flows... π Validating flows for peer cilium-test/client2-646b88fb9b-w5rck βΉοΈ SYN and(ip(src=10.244.1.113),or(tcp(dstPort=30171),tcp(dstPort=8080)),tcpflags(syn)) not found β Aborting flow matching: context deadline exceeded β Flow validation failed for peer cilium-test/client2-646b88fb9b-w5rck: 1 failures (first: -1, last: -1, matched: 0) π Flow logs for peer cilium-test/client2-646b88fb9b-w5rck: β [0] Nov 10 06:46:22.847: cilium-test/client2-646b88fb9b-w5rck:50890 -> [fc00:c111::3]:30171 from-endpoint FORWARDED TRAFFIC_DIRECTION_UNKNOWN DROP_REASON_UNKNOWN (TCP Flags: SYN) β [1] Nov 10 06:46:22.847: cilium-test/client2-646b88fb9b-w5rck:50890 -> [fc00:c111::3]:30171 to-stack FORWARDED EGRESS DROP_REASON_UNKNOWN (TCP Flags: SYN) β [2] Nov 10 06:46:22.848: [fc00:c111::3]:30171 -> cilium-test/client2-646b88fb9b-w5rck:50890 from-host FORWARDED TRAFFIC_DIRECTION_UNKNOWN DROP_REASON_UNKNOWN (TCP Flags: SYN, ACK) β [3] Nov 10 06:46:22.848: [fc00:c111::3]:30171 -> cilium-test/client2-646b88fb9b-w5rck:50890 to-endpoint FORWARDED EGRESS DROP_REASON_UNKNOWN (TCP Flags: SYN, ACK) Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
jrajahalme
force-pushed
the
fix-nodeport-flow-validation
branch
from
November 14, 2023 11:32
92c66a0
to
8dea982
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix
NodeportService.Address()
IPv6 check and generalizeNodeportService
by using in[]corev1.NodeAddress
instead of*corev1.Node
so that test cases can customize the addresses to be used. UseNodeportService
to simplify special casing for nodeport tests.Pass the IP family of the current node address to
t.NewAction()
, so that the address of the correct family is used in flow validation. This fixes the bug where IPv4 address is being used to validate an IPv6 flow like below: