Endpoints registered as UDP show as TCP
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
When adding a UDP endpoint to a resource, the URI scheme is set to TCP
.WithEndpoint(ConsulResource.DnsEndpointName, ea =>
{
ea.Protocol = ProtocolType.Udp;
ea.Port = dnsPort ;
ea.TargetPort = ConsulResource.DefaultDnsPort;
})
Steps To Reproduce
Run the code above and inspect the annotations collection for the resource
Exceptions (if any)
No response
.NET Version info
- .NET Aspire version 8.2.1
Anything else?
No response
Seems like a simple issue with how we infer the scheme from the transport and protocol.
This is not actually a bug. The overload of WithEndpoint which is being used here is the callback variant which is designed to be used to get at every individual property of the endpoint. The EndpointAnnotation does not automatically change the UriScheme of the endpoint if you change the protocol - thats up to the person doing the callback to set everything away from the default (which is TCP).