dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.82k stars 456 forks source link

WithPgAdmin(c => c.WithLifetime(...)) not resulting in persistent PgAdmin container. #6326

Open mitchdenny opened 2 weeks ago

mitchdenny commented 2 weeks ago

Is there an existing issue for this?

Describe the bug

This does not appear to result in a persistent pgadmin container:

var pg = builder.AddPostgres("pg")
                .WithLifetime(ContainerLifetime.Persistent)
                .WithDataVolume()
                .WithPgAdmin(c => {
                    c.WithLifetime(ContainerLifetime.Persistent);
                });

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

mitchdenny commented 2 weeks ago

I think it could be the way the config file is generated.

davidfowl commented 1 week ago

We should consider using a hash of the resource names that are being configured (in the above case postgres resources). We can also consider setting the lifetime key directly on the container instance.