-
Notifications
You must be signed in to change notification settings - Fork 89
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
dns: fix headless service handling #1056
Conversation
Before, we treated any service without a VIP as headless. This is not correct. Consider ```yaml apiVersion: networking.istio.io/v1 kind: ServiceEntry metadata: name: external hosts: - httpbin.org location: MESH_EXTERNAL ports: - number: 80 name: http resolution: DNS ``` We should NOT treat this as headless. The implementation is a total hack, but a better fix requires WDS changes so for now a short approach is best
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 mostly seems ok... not sure about blind trimming 1 character though
src/dns/server.rs
Outdated
// Domain will be like `.svc.cluster.local.` (trailing .), so ignore the last character. | ||
let domain = self.svc_domain.to_utf8(); | ||
!service.vips.is_empty() | ||
|| service.hostname.ends_with(&domain[..domain.len() - 1]) |
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 we use strip_suffix(...).expect("the svc domain must have a trailing '.'") which is a firmer assertion of the form of the svc_domain since malformed will cause a panic but won't quietly behave badly if our assumptions were false.
952c855
to
d83525c
Compare
d83525c
to
ff5e62d
Compare
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.
lgtm
In response to a cherrypick label: new pull request created: #1058 |
Before, we treated any service without a VIP as headless. This is not
correct. Consider
We should NOT treat this as headless.
The implementation is a total hack, but a better fix requires WDS
changes so for now a short approach is best
Fixes #909
Fixes #554