dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.8k stars 450 forks source link

Add WithDataVolume to Redis Insights #6299

Open eerhardt opened 1 week ago

eerhardt commented 1 week ago

Background and Motivation

When using Redis Insights, every time you F5 and launch the container you get prompted with a privacy and license acceptance prompt the first time you hit the Redis Insights page.

To solve this, we should add a method that configures a data volume on the container. That way you only need to accept the license and privacy statement the first time.

Proposed API

namespace Aspire.Hosting;

public static class RedisBuilderExtensions
{
+    public static IResourceBuilder<RedisInsightResource> WithDataVolume(this IResourceBuilder<RedisInsightResource>, string? name = null);
}

Usage Examples

var redis = builder.AddRedis("redis")
    .WithDataVolume()
    .WithRedisInsight(i => i.WithDataVolume());
Alirexaa commented 1 week ago

I will work on this.

eerhardt commented 1 week ago

I will work on this.

Thanks @Alirexaa. If we are able to merge it before Friday it can make the 9.0.0 release. If not, it can catch the next release. Not a huge problem.

eerhardt commented 1 week ago

But it may be better if we fix WithRedisInsight and ContainerLifetime.Persistent causes multiple instances to show up (dotnet/aspire#6111) either before or at the same time.

Alirexaa commented 1 week ago

Thanks @Alirexaa. If we are able to merge it before Friday it can make the 9.0.0 release. If not, it can catch the next release. Not a huge problem.

I'm not sure PR is prepared for tomorrow.

eerhardt commented 1 week ago

I'm not sure PR is prepared for tomorrow.

that's totally fine. Not a problem. It can get in when it gets in.