-
Notifications
You must be signed in to change notification settings - Fork 109
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
Support ip_families field in service #1161
Conversation
Skipping CI for Draft Pull Request. |
/test all |
src/dns/server.rs
Outdated
service | ||
.endpoints | ||
.iter() | ||
.filter_map(|(_, ep)| match &ep.address { | ||
Some(addr) => { | ||
if let Some(false) = family.map(|f| f.accepts_ip(addr.address)) { |
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.
@howardjohn I am not quite understanding this, checking record_type has already filtered unmatched ipfamily.
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.
example is a user queries A for a service with IP family Ipv6. We need to move sure we do NOT return ipv4 addresses
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.
If this is a clientside defense against a server bug, it needs an error log.
(And a test, this is basically covering a scenario where a v4 is returned for an AAAA record, which is violently against the DNS spec)
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.
This is not protection against a bug. Its perfectly valid for a client to send a A request for a service that is specified as IPv6 only, we just need to return no IPs.
Additionally ,there is a test that covers this exact scenario that I added alongside the PR.
(And a test, this is basically covering a scenario where a v4 is returned for an AAAA record, which is violently against the DNS spec)
No, I think there is a confusion. This is:
- Client sends A request for Service X
- Service X is IPv6 only, selects pods that are IPv4 AND IPv6
- Before: we would return IPv4 address. Expected/with this PR: we do not respond
In no scenario are were (with or without this PR) sending IPv4 responses to AAAA or IPv6 responses to A
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.
That being said I think I can short-circuit this check to be at the service level instead of the pod level to give the same behavior.
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.
Ok, changed to a service level check. Should be more clear now hopefully
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.
LMK if that addresses the concerns
Istio side istio/istio#51606
This implements the new ip_families field for services:
Add a new IPFamilies field to service. This is used for two things:
Fixes #1152