-
Notifications
You must be signed in to change notification settings - Fork 558
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
Hosting.Keycloak: Fix importDirectory
param validation in WithRealmImport
#5220
Conversation
81f9b6b
to
88d4681
Compare
WithRealmImport
The import path is expected to be relative to the AppHost path, but here it was being used as-is - relative to the current working directory. Instead, remove the check and let the downstream `WithBindMount` method use the path correctly. This manifested as a failure to import the file when running the app with `Aspire.Hosting.Testing` which would start the apphost with cwd!=apphost .
88d4681
to
972f9a9
Compare
cc @julioct |
tests/TestingAppHost1/TestingAppHost1.AppHost/TestingAppHost1.AppHost.csproj
Outdated
Show resolved
Hide resolved
We can drop the changes in aspire/playground/keycloak/Keycloak.ApiService/Program.cs Lines 28 to 40 in 972f9a9
|
# Conflicts: # tests/Aspire.Playground.Tests/AppHostTests.cs # tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj
Looks like
I'll restore the check, and expand the path using the apphost path. |
WithRealmImport
importDirectory
param validation in WithRealmImport
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.
LGTM
src/Aspire.Hosting.Keycloak/KeycloakResourceBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
# Conflicts: # tests/Aspire.Playground.Tests/AppHostTests.cs # tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj
src/Aspire.Hosting.Keycloak/KeycloakResourceBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Merge after #5276 . |
Description
The import path is expected to be relative to the AppHost path, but here
it was being used as-is - relative to the current working directory.
Instead, expand the path relative to the AppHost path and use that for
Directory.Exists
check.This manifested as a failure to import the file when running the app
with
Aspire.Hosting.Testing
which would start the apphost withcwd!=apphost .
Checklist
<remarks />
and<code />
elements on your triple slash comments?Microsoft Reviewers: Open in CodeFlow