Implement missing HTTP host to ConsulResolver func for Connect SDK. #4392
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I managed to remove a TODO in Connect SDK that was not done. I thought it was because we have tests for HTTPClient but the part that we made pluggable to ease testing actually didn't have a non-test implementation 😱 .
This fixes that.
UX Gotcha
In general this will work OK as a basic experience. It's a bit of a gotcha that we only support
.consul
TLD in the HTTP client hostnames even if your actual Consul DNS is configured with a custom domain. The reason for that is that without making external calls and adding much complication, we don't actually know what the correct domain is, and in conjunction with the datacenter suffix being optional, it becomes impossible to unambiguously tell the difference between a custom domain segment and a datacenter name (which matters because we want to support explicit requests to other DCs).We could potentially revisit this in the future if it seems to be a big issue for folks but it is simplest to just document it for now.
Docs updates to explain this: