Skip to content
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

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

tpantelis
Copy link
Contributor

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.

@submariner-bot
Copy link
Contributor

🤖 Created branch: z_pr1641/tpantelis/clusterset_vip_plugin
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

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]>
@@ -88,3 +88,7 @@ func (si *serviceInfo) selectIP(checkCluster func(string) bool) *DNSRecord {

return nil
}

func (si *serviceInfo) isHeadless() bool {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@submariner-bot submariner-bot added the ready-to-test When a PR is ready for full E2E testing label Sep 24, 2024
@aswinsuryan aswinsuryan merged commit bead0f9 into submariner-io:devel Sep 24, 2024
26 checks passed
@submariner-bot
Copy link
Contributor

🤖 Closed branches: [z_pr1641/tpantelis/clusterset_vip_plugin]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-test When a PR is ready for full E2E testing
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants