-
Notifications
You must be signed in to change notification settings - Fork 35
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
Implement clusterset IP in the CoredDNS plugin #1641
Implement clusterset IP in the CoredDNS plugin #1641
Conversation
🤖 Created branch: z_pr1641/tpantelis/clusterset_vip_plugin |
d3016f3
to
2a727e3
Compare
Modify the resolver to return the ServiceImport's IP if it's set and a specific cluster name wasn't requested. If the latter then return the cluster's DNS record info as it normally does. Signed-off-by: Tom Pantelis <[email protected]>
2a727e3
to
6bac66a
Compare
@@ -88,3 +88,7 @@ func (si *serviceInfo) selectIP(checkCluster func(string) bool) *DNSRecord { | |||
|
|||
return nil | |||
} | |||
|
|||
func (si *serviceInfo) isHeadless() bool { |
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.
QQ: I know it's a small function, but performance-wise - isn't it better to keep the current code ? I mean calculate it once when serviceInfo is created and not every time DNS resolver is called.
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.
I made it a method for readability and to avoid duplicate storage. It might be a little faster as a variable but the difference would be extremely negligible (probably in nanosec). Plus compilers are pretty smart about optimizing and caching frequently accessed code.
🤖 Closed branches: [z_pr1641/tpantelis/clusterset_vip_plugin] |
Modify the resolver to return the
ServiceImport'
s IP if it's set and a specific cluster name wasn't requested. If the latter then return the cluster's DNS record info as it normally does.