aspire
aspire copied to clipboard
Make username parameter always be injected.
Fixes #4100 and #4099
This PR does a few things:
- Changes the PgAdmin config writer hook to use the password from
UserNameParameteron the Postgres server resource. - Changes the
UserNameParameteron the postgres server resource to be non-nullable and adjust in the constructor as well.
The reason for this change is that if you want to use the Postgres database resource from a container that is not built around .NET, the connection string format that the resource exposes won't necessarily be in the format that you want. For that reason you want to be able to get at the username and password parameters and know that they are always there. The password parameter is fine, but the fact that the username parameter is optional is problematic and makes consuming code more complex.
This represents a breaking change ... see unshipped API diff.
Microsoft Reviewers: Open in CodeFlow
We should be able to finish this now.
@mitchdenny I think this is worth doing but not sure it's critical for 9. There's another PR from a contributor here https://github.com/dotnet/aspire/pull/5805
Yeah can punt this one.