-
Notifications
You must be signed in to change notification settings - Fork 707
Add ability to configure Port and Password for Redis and Postgres and SqlServer when they configured to run by RunAsContainer
#8439
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
Changes from 17 commits
4e998d2
77d57bf
a26d3f9
aefd4e8
f0bd95d
57ceb4c
96849d2
f462b63
4aef0cd
0390ba0
cf5fe47
928604c
9f2ba9b
6395a7a
f3dbd6d
da00ccf
12056d4
57e9c86
8fc5950
47ecfed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -424,6 +424,58 @@ public static IResourceBuilder<PostgresDatabaseResource> WithCreationScript(this | |||||||||
| return builder; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /// <summary> | ||||||||||
| /// Configures the password that the PostgreSQL resource is used. | ||||||||||
| /// </summary> | ||||||||||
| /// <param name="builder">The resource builder.</param> | ||||||||||
| /// <param name="password">The parameter used to provide the password for the PostgreSQL resource.</param> | ||||||||||
| /// <returns>The <see cref="IResourceBuilder{T}"/>.</returns> | ||||||||||
| public static IResourceBuilder<PostgresServerResource> WithPassword(this IResourceBuilder<PostgresServerResource> builder, IResourceBuilder<ParameterResource> password) | ||||||||||
| { | ||||||||||
| ArgumentNullException.ThrowIfNull(builder); | ||||||||||
| ArgumentNullException.ThrowIfNull(password); | ||||||||||
|
|
||||||||||
| builder.Resource.SetPassword(password.Resource); | ||||||||||
| return builder.WithEnvironment(context => | ||||||||||
| { | ||||||||||
| context.EnvironmentVariables[PasswordEnvVarName] = builder.Resource.PasswordParameter; | ||||||||||
| }); | ||||||||||
|
||||||||||
| .WithEnvironment(context => | |
| { | |
| context.EnvironmentVariables[UserEnvVarName] = postgresServer.UserNameReference; | |
| context.EnvironmentVariables[PasswordEnvVarName] = postgresServer.PasswordParameter; |
(repeated elsewhere) #Closed
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,6 +88,20 @@ public ReferenceExpression ConnectionStringExpression | |
| /// </summary> | ||
| public IReadOnlyDictionary<string, string> Databases => _databases; | ||
|
|
||
| internal void SetPassword(ParameterResource password) | ||
| { | ||
| ArgumentNullException.ThrowIfNull(password); | ||
|
|
||
| PasswordParameter = password; | ||
|
||
| } | ||
|
|
||
| internal void SetUserName(ParameterResource userName) | ||
| { | ||
| ArgumentNullException.ThrowIfNull(userName); | ||
|
|
||
| UserNameParameter = userName; | ||
| } | ||
|
|
||
| internal void AddDatabase(string name, string databaseName) | ||
| { | ||
| _databases.TryAdd(name, databaseName); | ||
|
|
||
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.
Is this necessary?
cc @danmoseley @sebastienros
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.
I'm not sure.