aspire
aspire copied to clipboard
WithRedisInsight and ContainerLifetime.Persistent causes multiple instances to show up
If I have the following:
var builder = DistributedApplication.CreateBuilder(args);
var redis = builder.AddRedis("redis")
.WithDataVolume()
.WithRedisInsight(c => c.WithLifetime(ContainerLifetime.Persistent));
builder.AddProject<Projects.Redis_ApiService>("apiservice")
.WithReference(redis).WaitFor(redis);
builder.Build().Run();
When I run multiple times, the RedisInights container stays running, but each time I run a new Redis instance shows up in it:
We should fix this so the same redis instance isn't added on re-run.
What happens for RedisComander, Pgweb, Pgadmin, and other dashboards when using ContainerLifetime.Persistent?
What happens for RedisComander, Pgweb, Pgadmin, and other dashboards when using
ContainerLifetime.Persistent?
Unsure. It needs to be tested.
Here's another way to get the same results:
var redis = builder.AddRedis("redis")
.WithRedisInsight(c => c.WithVolume("insights", "/data"));
Since the data will be persisted, each time you run it creates a new entry.
OK so the fix here is to make the API call see if it is already registered.
Yep
@Alirexaa can you get to this change this week? It's our last week to make 9.x fixes.
@Alirexaa can you get to this change this week? It's our last week to make 9.x fixes.
I want to fix this with https://github.com/dotnet/aspire/issues/6299 but mitchdenny already started.