Service Discovery: allow multiple schemes to be specified in request#2719
Merged
ReubenBond merged 7 commits intomainfrom Mar 9, 2024
Merged
Service Discovery: allow multiple schemes to be specified in request#2719ReubenBond merged 7 commits intomainfrom
ReubenBond merged 7 commits intomainfrom
Conversation
…nt name to configuration path.
davidfowl
reviewed
Mar 8, 2024
davidfowl
reviewed
Mar 8, 2024
… property on EndpointAnnotation
533d3d5 to
acf0398
Compare
davidfowl
reviewed
Mar 8, 2024
| var a = new AllocatedEndpointAnnotation( | ||
| sp.EndpointAnnotation.Name, | ||
| PortProtocol.ToProtocolType(svc.Spec.Protocol), | ||
| sp.EndpointAnnotation.AllocatedEndpoint = new AllocatedEndpoint( |
davidfowl
approved these changes
Mar 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR adds support in Service Discovery for specifying multiple schemes during resolution, separated by a
+character. This allows developers to enforce HTTPS in production while falling back to HTTP during development and testing.For example, a user can allow both HTTPS and HTTP like so:
The order of schemes is important: if endpoints are found matching the first scheme, no endpoints from subsequent schemes are allowed.
This PR also introduces configuration to specify an allow-list of acceptable schemes for service discovery:
For example, to allow only
https://:To allow
http://orhttps://:To allow any scheme (the default):
This PR changes the format of Service Discovery configuration so that the endpoint name is included in the configuration path, if an endpoint name is set. If no endpoint name is specified, then the scheme is used (and again, schemes are checked in the specified order, with only the first present being selected). If no endpoint name or scheme is specified,
"default"is used as the endpoint name.Microsoft Reviewers: Open in CodeFlow