Skip to content

Commit 219b72a

Browse files
committed
merge
1 parent c778dde commit 219b72a

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

playground/ProxylessEndToEnd/ProxylessEndToEnd.AppHost/Program.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99
});
1010

1111
builder.AddProject<Projects.ProxylessEndToEnd_ApiService>("api")
12-
.WithEndpoint("http", ea =>
13-
{
14-
ea.UriScheme = "http";
15-
ea.Port = 12345;
16-
ea.IsProxied = false;
17-
})
12+
.WithEndpoint(12345, "http", isProxied: false)
1813
.WithReference(redis);
1914

2015
builder.AddProject<Projects.ProxylessEndToEnd_ApiService>("api2")

playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/Program.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
var db1 = builder.AddSqlServer("sql1").PublishAsAzureSqlDatabase().AddDatabase("db1");
77
var db2 = builder.AddSqlServer("sql2").PublishAsContainer().AddDatabase("db2");
88

9-
builder.AddProject<Projects.SqlServerEndToEnd_ApiService>("api")
10-
.WithReference(db1)
11-
.WithReference(db2);
9+
//var db1 = builder.AddSqlServer("sql1").AddDatabase("db1");
10+
//var db2 = builder.AddSqlServer("sql2").PublishAsContainer().AddDatabase("db2");
11+
12+
builder.AddProject<Projects.SqlServerEndToEnd_ApiService>("api");
13+
//.WithReference(ai);
1214

1315
// This project is only added in playground projects to support development/debugging
1416
// of the dashboard. It is not required in end developer code. Comment out this code

src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public sealed class EndpointAnnotation : IResourceAnnotation
2626
/// <param name="containerPort">If the endpoint is used for the container, this is the port the container process is listening on.</param>
2727
/// <param name="isExternal">Indicates that this endpoint should be exposed externally at publish time.</param>
2828
/// <param name="env">The name of the environment variable that will be set to the port number of this endpoint.</param>
29+
/// <param name="isProxied">Specifies if the endpoint will be proxied by DCP. Defaults to true.</param>
2930
public EndpointAnnotation(ProtocolType protocol, string? uriScheme = null, string? transport = null, string? name = null, int? port = null, int? containerPort = null, bool? isExternal = null, string? env = null, bool isProxied = true)
3031
{
3132
// If the URI scheme is null, we'll adopt either udp:// or tcp:// based on the

src/Aspire.Hosting/Dcp/ApplicationExecutor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ private async Task CreateContainersAsync(IEnumerable<AppResource> containerResou
758758

759759
if (!sp.EndpointAnnotation.IsProxied)
760760
{
761+
// When DCP isn't proxying the container we need to set the host port that the containers internal port will be mapped to
761762
portSpec.HostPort = sp.EndpointAnnotation.Port;
762763
}
763764

src/Aspire.Hosting/Dcp/DcpDistributedApplicationLifecycleHook.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private static void PrepareServices(DistributedApplicationModel model)
4545

4646
if (endpointAnnotations.Any())
4747
{
48+
// We have a non-proxied endpoint with the same name as the 'url', don't add another endpoint for the same name
4849
continue;
4950
}
5051

src/Aspire.Hosting/Extensions/ResourceBuilderExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ private static void ApplyEndpoints<T>(this IResourceBuilder<T> builder, IResourc
323323
/// <param name="env"></param>
324324
/// <returns></returns>
325325
[Obsolete("WithServiceBinding has been renamed to WithEndpoint. Use WithEndpoint instead.")]
326-
public static IResourceBuilder<T> WithServiceBinding<T>(this IResourceBuilder<T> builder, int? hostPort = null, string? scheme = null, string? name = null, string? env = null, bool isProxied = true) where T : IResource
326+
public static IResourceBuilder<T> WithServiceBinding<T>(this IResourceBuilder<T> builder, int? hostPort = null, string? scheme = null, string? name = null, string? env = null) where T : IResource
327327
{
328-
return builder.WithEndpoint(hostPort: hostPort, scheme: scheme, name: name, env: env, isProxied: isProxied);
328+
return builder.WithEndpoint(hostPort: hostPort, scheme: scheme, name: name, env: env);
329329
}
330330

331331
/// <summary>
@@ -430,9 +430,9 @@ public static IResourceBuilder<T> WithHttpsEndpoint<T>(this IResourceBuilder<T>
430430
/// <param name="env"></param>
431431
/// <returns></returns>
432432
[Obsolete("WithServiceBinding has been renamed to WithEndpoint. Use WithEndpoint instead.")]
433-
public static IResourceBuilder<T> WithServiceBinding<T>(this IResourceBuilder<T> builder, int containerPort, int? hostPort = null, string? scheme = null, string? name = null, string? env = null, bool isProxied = true) where T : IResource
433+
public static IResourceBuilder<T> WithServiceBinding<T>(this IResourceBuilder<T> builder, int containerPort, int? hostPort = null, string? scheme = null, string? name = null, string? env = null) where T : IResource
434434
{
435-
return builder.WithEndpoint(containerPort: containerPort, hostPort: hostPort, scheme: scheme, name: name, env: env, isProxied: isProxied);
435+
return builder.WithEndpoint(containerPort: containerPort, hostPort: hostPort, scheme: scheme, name: name, env: env);
436436
}
437437

438438
/// <summary>

tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using Xunit;
1414
using Xunit.Abstractions;
1515
using Xunit.Sdk;
16-
using VolumeMountType = Aspire.Hosting.ApplicationModel.VolumeMountType;
1716

1817
namespace Aspire.Hosting.Tests;
1918

0 commit comments

Comments
 (0)