Skip to content

Commit 5108520

Browse files
authored
Merge branch 'main' into copilot/fix-718
2 parents 91305ae + a19aff3 commit 5108520

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/CommunityToolkit.Aspire.Hosting.Minio/MinioBuilderExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@ public static IResourceBuilder<MinioContainerResource> AddMinioContainer(
3939

4040
var resource = new MinioContainerResource(name, rootUserParameter, rootPasswordParameter);
4141

42+
const int consoleTargetPort = 9001;
4243
var builderWithResource = builder
4344
.AddResource(resource)
4445
.WithImage(MinioContainerImageTags.Image, MinioContainerImageTags.Tag)
4546
.WithImageRegistry(MinioContainerImageTags.Registry)
4647
.WithHttpEndpoint(targetPort: 9000, port: port, name: MinioContainerResource.PrimaryEndpointName)
47-
.WithHttpEndpoint(targetPort: 9001, name: MinioContainerResource.ConsoleEndpointName)
48+
.WithHttpEndpoint(targetPort: consoleTargetPort, name: MinioContainerResource.ConsoleEndpointName)
4849
.WithEnvironment(RootUserEnvVarName, resource.RootUser.Value)
4950
.WithEnvironment(RootPasswordEnvVarName, resource.PasswordParameter.Value)
50-
.WithArgs("server", "/data");
51+
.WithArgs("server", "/data", "--console-address", $":{consoleTargetPort}");
5152

5253
var endpoint = builderWithResource.Resource.GetEndpoint(MinioContainerResource.PrimaryEndpointName);
5354
var healthCheckKey = $"{name}_check";

tests/CommunityToolkit.Aspire.Hosting.Minio.Tests/AppHostTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ public async Task ResourceStartsAndRespondsOk()
2222
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
2323
}
2424

25+
[Fact]
26+
public async Task ResourceStartsAndUiRespondsOk()
27+
{
28+
var resourceName = "minio";
29+
await fixture.ResourceNotificationService.WaitForResourceHealthyAsync(resourceName).WaitAsync(TimeSpan.FromMinutes(5));
30+
var httpClient = fixture.CreateHttpClient(resourceName, "console");
31+
32+
var response = await httpClient.GetAsync("/");
33+
34+
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
35+
}
36+
2537
[Fact]
2638
public async Task ApiServiceCreateData()
2739
{

0 commit comments

Comments
 (0)