Skip to content
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

Revert "Missing applicationUrl does not inherit dashboard url (#1169)" #1303

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.MongoDB.Driver", "sr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.MongoDB.Driver.Tests", "tests\Aspire.MongoDB.Driver.Tests\Aspire.MongoDB.Driver.Tests.csproj", "{E592E447-BA3C-44FA-86C1-EBEDC864A644}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject.LaunchSettings", "tests\testproject\TestProject.LaunchSettings\TestProject.LaunchSettings.csproj", "{A734177E-213B-4D68-98A4-6F5C00234053}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -448,10 +446,6 @@ Global
{6472D59F-7C04-43DE-AD33-9F20BE3804BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6472D59F-7C04-43DE-AD33-9F20BE3804BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6472D59F-7C04-43DE-AD33-9F20BE3804BF}.Release|Any CPU.Build.0 = Release|Any CPU
{A734177E-213B-4D68-98A4-6F5C00234053}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A734177E-213B-4D68-98A4-6F5C00234053}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A734177E-213B-4D68-98A4-6F5C00234053}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A734177E-213B-4D68-98A4-6F5C00234053}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -529,7 +523,6 @@ Global
{20A5A907-A135-4735-B4BF-E13514F360E3} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2}
{E592E447-BA3C-44FA-86C1-EBEDC864A644} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
{DCF2D47A-921A-4900-B5B2-CF97B3531CE8} = {975F6F41-B455-451D-A312-098DE4A167B6}
{A734177E-213B-4D68-98A4-6F5C00234053} = {975F6F41-B455-451D-A312-098DE4A167B6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6DCEDFEC-988E-4CB3-B45B-191EB5086E0C}
Expand Down
12 changes: 6 additions & 6 deletions src/Aspire.Hosting/Dcp/ApplicationExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,12 @@ private async Task CreateExecutablesAsync(IEnumerable<AppResource> executableRes
}
else
{
// If there is no launch profile, we want to make sure that certain environment variables are NOT inherited
foreach (var envVar in s_doNotInheritEnvironmentVars)
{
config.Add(envVar, "");
}

if (er.ServicesProduced.Count > 0)
{
if (er.ModelResource is ProjectResource)
Expand Down Expand Up @@ -436,12 +442,6 @@ private async Task CreateExecutablesAsync(IEnumerable<AppResource> executableRes
}
}

// We want to make sure that certain environment variables are NOT inherited
foreach (var envVar in s_doNotInheritEnvironmentVars)
{
config.TryAdd(envVar, "");
}

spec.Env = new();
foreach (var c in config)
{
Expand Down
26 changes: 0 additions & 26 deletions tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,32 +423,6 @@ public async Task VerifyDockerAppWorks()
await app.StopAsync();
}

[LocalOnlyFact]
public async Task NoUrlInLaunchSettings()
{
var testProgram = CreateTestProgram();
testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper));

testProgram.AppBuilder.AddProject("launch", new Projects.TestProject_LaunchSettings().ProjectPath);

await using var app = testProgram.Build();

await app.StartAsync();

var s = app.Services.GetRequiredService<KubernetesService>();
var list = await s.ListAsync<Executable>();

var proj = list.FirstOrDefault(x => x.Spec.WorkingDirectory?.Contains("LaunchSettings") == true);

Assert.NotNull(proj);
Assert.NotNull(proj.Spec.Env);

// URLs isn't set in launch settings, and shouldn't be inherited from dashboard
Assert.Null(proj.Spec.Env.First(x => x.Name == "ASPNETCORE_URLS").Value);

await app.StopAsync();
}

private static TestProgram CreateTestProgram(string[]? args = null, bool includeIntegrationServices = false, bool includeNodeApp = false) =>
TestProgram.Create<DistributedApplicationTests>(args, includeIntegrationServices: includeIntegrationServices, includeNodeApp: includeNodeApp);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<ProjectReference Include="..\TestProject.ServiceB\TestProject.ServiceB.csproj" ServiceNameOverride="ServiceB" />
<ProjectReference Include="..\TestProject.ServiceC\TestProject.ServiceC.csproj" ServiceNameOverride="ServiceC" />
<ProjectReference Include="..\TestProject.WorkerA\TestProject.WorkerA.csproj" ServiceNameOverride="WorkerA" />
<ProjectReference Include="..\TestProject.LaunchSettings\TestProject.LaunchSettings.csproj" ServiceNameOverride="LaunchSettings" />
</ItemGroup>

</Project>
10 changes: 0 additions & 10 deletions tests/testproject/TestProject.LaunchSettings/Program.cs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions tests/testproject/TestProject.LaunchSettings/appsettings.json

This file was deleted.