In this code I am constructing a custom connection string for NocoDB which points to a Postgres database (note I could just use the string interpolation handler thing, it amounts to the same thing).
The problem is that when I use the code like this:
... where I have one container referencing another container (NocoDB is referencing Postgres) ... I need the hostname to be host.docker.internal or the Podman alternative. But the transformation that we do for EndpointReference and ConnectionStringReference don't work. We need this transformation to work for EndpointReferenceExpression as well (the result from EndpointReference.Property(EndpointProperty.Host)).
Consider the following code:
https://github.com/mitchdenny/nocodb-aspire/blob/90ddebde4362508c7c4c8358b110d778baa80446/src/NocoDB/NocoDB.Hosting/NocoDBExtensions.cs#L21-L32
In this code I am constructing a custom connection string for NocoDB which points to a Postgres database (note I could just use the string interpolation handler thing, it amounts to the same thing).
The problem is that when I use the code like this:
https://github.com/mitchdenny/nocodb-aspire/blob/90ddebde4362508c7c4c8358b110d778baa80446/src/NocoDB/NocoDB.AppHost/Program.cs#L6-L10
... where I have one container referencing another container (NocoDB is referencing Postgres) ... I need the hostname to be
host.docker.internal
or the Podman alternative. But the transformation that we do forEndpointReference
andConnectionStringReference
don't work. We need this transformation to work forEndpointReferenceExpression
as well (the result fromEndpointReference.Property(EndpointProperty.Host)
).Here is the code in question:
https://github.com/dotnet/aspire/blob/c6b9f8e195f5b1cd72951f447d35aae527b381b4/src/Aspire.Hosting/Dcp/ApplicationExecutor.cs#L1299-L1303