-
Notifications
You must be signed in to change notification settings - Fork 479
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
Do not set TargetPort to Port when IsProxying is also set #3372
Conversation
8417a69
to
0526414
Compare
(cherry picked from commit 09f5ae9)
Co-authored-by: Eric Erhardt <[email protected]>
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
Can you re gen the manifests? I want to see if there are any changes |
cc @vhvb1989 |
Is there a way to do that across all projects? We have some tests which check manifest output and they did not change |
* Do not set TargetPort to Port when IsProxied is true * Move TargetPort check to ApplicationExecutor * Apply port selection logic to manifest publishing (cherry picked from commit 09f5ae9) * Update src/Aspire.Hosting/Dcp/ApplicationExecutor.cs Co-authored-by: Eric Erhardt <[email protected]> --------- Co-authored-by: Eric Erhardt <[email protected]>
We should really add an official way to do it to the repo, but here's a hack powershell script that I used a few weeks ago:
|
I ran the script and compared main vs prior to this commit and got the same results. |
* Added ability to resolve target port (#3305) * Added ability to resolve target port - Change how we process and expose target ports. This change makes it possible to avoid using any internals of DCP to access and resolve target ports from any resource. - More launch profile processing to the project resource defaults. - Remove logic in the manifest writing that wrote a special env variable. This should just work now like everything else. - Exposed TargetPort and Exists on EndpointReference. - Use this new target property with dapr. - Added a ReferenceExpressionBuilder which makes it possible to dynamically build a ReferenceExpression. - Endpoints and env are evaulated earlier now so change remove tests that add default launch profile on real projects without allocating those endpoints. * Remove more uses of TestProgram * Fix tests * Rename DcpServiceName to TargetPortExpression (#3371) This allows us to not leak "DCP" into the public API and keeps DCP-isms contained in the DCP code. * Do not set TargetPort to Port when IsProxying is also set (#3372) * Do not set TargetPort to Port when IsProxied is true * Move TargetPort check to ApplicationExecutor * Apply port selection logic to manifest publishing (cherry picked from commit 09f5ae9) * Update src/Aspire.Hosting/Dcp/ApplicationExecutor.cs Co-authored-by: Eric Erhardt <[email protected]> --------- Co-authored-by: Eric Erhardt <[email protected]> --------- Co-authored-by: David Fowler <[email protected]> Co-authored-by: Reuben Bond <[email protected]>
When creating endpoint annotations, if a TargetPort is equal to the Port for a non-Container resource (and non-null) and IsProxying is true, that is an error: DCP cannot bind a proxy to a port which the target service is also bound to.
This PR does two things:
TargetPort
toPort
automatically ifIsProxying
is true.TargetPort == Port && IsProxying
, then we throw during startupMicrosoft Reviewers: Open in CodeFlow