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

Add callback to WithPgAdmin to allow customization. #3801

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

mitchdenny
Copy link
Member

@mitchdenny mitchdenny commented Apr 18, 2024

Related: #3770

This PR modifies the arguments for WithPgAdmin to take a callback which allows for a greater array of customization. Usage example:

builder.AddPostgres("pgslq").WithPgAdmin(c => c.WithImageTag("8.3").UseHostPort(8999));
Microsoft Reviewers: Open in CodeFlow

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Apr 18, 2024
@mitchdenny mitchdenny added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Apr 18, 2024
@mitchdenny mitchdenny added this to the GA milestone Apr 18, 2024
@mitchdenny mitchdenny self-assigned this Apr 18, 2024
@mitchdenny mitchdenny merged commit 06d8886 into main Apr 18, 2024
8 checks passed
@mitchdenny mitchdenny deleted the mitchdenny/add-pgadmin-callback branch April 18, 2024 04:52
mitchdenny added a commit that referenced this pull request Apr 18, 2024
* Add callback to WithPgAdmin to allow customization.

* Fix const names.
/// <param name="builder">The resource builder for PGAdmin.</param>
/// <param name="port">The port to bind on the host. If null is used random port will be assigned.</param>
/// <returns>The resource builder for PGAdmin.</returns>
public static IResourceBuilder<PgAdminContainerResource> UseHostPort(this IResourceBuilder<PgAdminContainerResource> builder, int? port)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new right? Are we sure Use is the right prefix here? Seems odd that this method is only available for this resource type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's what we do with the other azure resources that have emulators:

public static IResourceBuilder<AzureStorageEmulatorResource> UseBlobPort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)

RussKie pushed a commit that referenced this pull request Apr 19, 2024
* Fix WithEnvironment with wrong type constraint. (#3750)

* Add WithDataVolume() and WithDataBindMount() APIs to Seq. (#3762)

* Add WithDataVolume() and WithDataBindMount() APIs to Seq.

* Add callback to WithPgAdmin to allow customization. (#3801)

* Add callback to WithPgAdmin to allow customization.

* Fix const names.

* Fixed NATS volume mounts (#3763)

* Fixed NATS volume mounts

---------

Co-authored-by: Ziya Suzen <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants