-
Notifications
You must be signed in to change notification settings - Fork 839
Extend service discovery to support Consul-based DNS lookups: #6914
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR extends service discovery to support HashiCorp Consul-based DNS lookups by implementing new DNS resolver configuration options and query customization capabilities. The changes enable flexible DNS server configuration and customizable DNS SRV query construction to support Consul service discovery patterns.
- Refactors DNS resolver options to support runtime configuration and custom DNS servers
- Adds configurable DNS SRV query construction for Consul-style lookups
- Updates dependency injection patterns to support options-based configuration
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
DnsSrvServiceEndpointProviderOptions.cs |
Adds ResolverOptions property and GetQueryText delegate for custom DNS query construction |
ResolverOptions.cs |
Converts from internal sealed class to public class with properties and XML documentation |
DnsResolver.cs |
Adds Create factory method and updates constructor to handle empty server lists |
DnsSrvServiceEndpointProviderFactory.cs |
Updates to use custom query text generation when configured |
ServiceDiscoveryDnsServiceCollectionExtensions.cs |
Changes DI registration to use factory method |
ResolvConf.cs |
Refactors to return server list instead of ResolverOptions |
NetworkInfo.cs |
Refactors to return server list instead of ResolverOptions |
Test files | Updates test instantiations to match new constructor signatures |
@ReubenBond @rzikm can you take a look? |
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.
Thanks for picking this one up. Comments are mostly about naming since I did not give too much thought to them since they were originally meant to be internal.
src/Libraries/Microsoft.Extensions.ServiceDiscovery.Dns/Resolver/ResolverOptions.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.ServiceDiscovery.Dns/DnsSrvServiceEndpointProviderOptions.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.ServiceDiscovery.Dns/DnsSrvServiceEndpointProviderOptions.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.ServiceDiscovery.Dns/DnsSrvServiceEndpointProviderOptions.cs
Outdated
Show resolved
Hide resolved
Also, do we not have to go through https://apireview.net/ since this is public API? |
@rzikm Thanks for the review. I've pushed changes to address them. The link "Details about the pull request review procedure" at https://github.com/dotnet/extensions/blob/main/CONTRIBUTING.md#suggested-workflow is dead, so it's unclear to me what the process is. Can I assume you'll resolve each open conversation that is addressed as desired? |
54fa852
to
320874c
Compare
src/Libraries/Microsoft.Extensions.ServiceDiscovery.Dns/Resolver/DnsResolver.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.ServiceDiscovery.Dns/DnsSrvServiceEndpointProviderOptions.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.ServiceDiscovery.Dns/Resolver/DnsResolverOptions.cs
Outdated
Show resolved
Hide resolved
- Enable specifying how to construct the DNS SRV query - Enable adding the Consul DNS server host/port
cc0c257
to
b2404be
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
@davidfowl Changes were reviewed and approved. Do we need public API review first, or is this ready to be merged? |
As long as @rzikm and @ReubenBond approve, I'm good! |
This PR provides the building blocks for dotnet/aspire#11740.
Extend service discovery to support HashiCorp Consul-based DNS lookups:
Microsoft Reviewers: Open in CodeFlow