-
Notifications
You must be signed in to change notification settings - Fork 496
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
Endpoint changes #3274
Endpoint changes #3274
Conversation
@@ -277,9 +278,49 @@ public void WriteBindings(IResource resource, bool emitContainerPort = false) | |||
Writer.WriteString("protocol", endpoint.Protocol.ToString().ToLowerInvariant()); | |||
Writer.WriteString("transport", endpoint.Transport); | |||
|
|||
if (emitContainerPort && endpoint.ContainerPort is { } containerPort) | |||
int? targetPort = (resource, endpoint.UriScheme, endpoint.TargetPort) switch |
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.
Nice!
…nifest, we must include port information. At runtime most of the port information is dynamically generated and thus not described (for anything but containers), that doesn't work well when trying to deploy to various environments. We allocate ports in situations where there are none to match the runtime behavior. - Change also renames ContainerPort to TargetPort everywhere. - Added `WithExternalHttpEndpoints` to mark all http and https endpoints as external.
0cb7808
to
d675afb
Compare
/backport to release/8.0-preview5 |
Started backporting to release/8.0-preview5: https://github.com/dotnet/aspire/actions/runs/8478915721 |
@davidfowl backporting to release/8.0-preview5 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: - In order for tools to better describe multiple endpoints int the manifest, we must include port information. At runtime most of the port information is dynamically generated and thus not described (for anything but containers), that doesn't work well when trying to deploy to various environments. We allocate ports in situations where there are none to match the runtime behavior. - Change also renames ContainerPort to TargetPort everywhere. - Added `WithExternalHttpEndpoints` to mark all http and https endpoints as external.
Using index info to reconstruct a base tree...
M src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs
M src/Aspire.Hosting/Dcp/ApplicationExecutor.cs
M tests/Aspire.Hosting.Tests/RabbitMQ/AddRabbitMQTests.cs
M tests/Aspire.Hosting.Tests/SqlServer/AddSqlServerTests.cs
Falling back to patching base and 3-way merge...
Auto-merging tests/Aspire.Hosting.Tests/SqlServer/AddSqlServerTests.cs
Auto-merging tests/Aspire.Hosting.Tests/RabbitMQ/AddRabbitMQTests.cs
Auto-merging src/Aspire.Hosting/Dcp/ApplicationExecutor.cs
Removing src/Aspire.Hosting/ApplicationModel/EndpointAnnotationExtensions.cs
Auto-merging src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs
CONFLICT (content): Merge conflict in src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 - In order for tools to better describe multiple endpoints int the manifest, we must include port information. At runtime most of the port information is dynamically generated and thus not described (for anything but containers), that doesn't work well when trying to deploy to various environments. We allocate ports in situations where there are none to match the runtime behavior. - Change also renames ContainerPort to TargetPort everywhere. - Added `WithExternalHttpEndpoints` to mark all http and https endpoints as external.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@davidfowl an error occurred while backporting to release/8.0-preview5, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
…nifest, we must include port information. At runtime most of the port information is dynamically generated and thus not described (for anything but containers), that doesn't work well when trying to deploy to various environments. We allocate ports in situations where there are none to match the runtime behavior. (#3274) - Change also renames ContainerPort to TargetPort everywhere. - Added `WithExternalHttpEndpoints` to mark all http and https endpoints as external.
* - In order for tools to better describe multiple endpoints int the manifest, we must include port information. At runtime most of the port information is dynamically generated and thus not described (for anything but containers), that doesn't work well when trying to deploy to various environments. We allocate ports in situations where there are none to match the runtime behavior. (#3274) - Change also renames ContainerPort to TargetPort everywhere. - Added `WithExternalHttpEndpoints` to mark all http and https endpoints as external. * Apply suggestions from code review Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com> --------- Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
WithExternalHttpEndpoints
to mark all http and https endpoints as external.The exposed port (port in the manifest) is the port used to talk to this binding.
The target port (targetPort in the manifest) is the port the resource binds to.
From Copilot:
These rules determine the values of the targetPort and exposedPort variables based on the properties of an endpoint object:
Next, the exposedPort is determined based on the following conditions:
Fixes #2099