-
Notifications
You must be signed in to change notification settings - Fork 531
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
Nest sidecar type resources by default in Dashboard #7259
Comments
These resources aren’t currently not sidecars as they show all databases. |
Oh I think I see what you're saying - even if there are multiple redis instance, there's still only a single commander / insights, so a direct parent/child relation doesn't really work. var redis = builder.AddRedis("redis").WithRedisCommander().WithRedisInsight();
var redis2 = builder.AddRedis("redis2").WithRedisCommander().WithRedisInsight(); Even if not applicable to the core resources suggested above, I'd still like an API so I can apply this to my own resources. |
Agree. @JamesNK it seems there’s no way outside of IResoueceWithParent |
What's the change you want? An annotation+method for nesting a resource as parent/child? |
I will try coming up with a PR for this approach. |
It looks like there already is aspire/src/Aspire.Hosting/ApplicationModel/ResourceRelationshipAnnotation.cs Lines 8 to 23 in 0dce648
Adding one of these with |
Lots of validation will be needed here to make sure:
An error needs to happen and it is better it happens when the app model is built and run. We want to avoid a the dashboard erroring when it tries to render something that's impossible. |
Should this be an error, or should we say "Last one wins" like we do for other annotations? |
Last wins sounds better |
@eerhardt as part of this change, use the attribute in a various resources (make an assesment of the ones where it makes sense to do so). |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
9.1's dashboard is adding support for showing parent / child resources as nested in the UI. This works by default for IResourceWithParent implementations (such as databases), but there are other instances where this could also be done - particularly for sidecar type containers such as redis insights, redis commander, pg admin etc.
As well as built in resources, I'd also like to be able to specify this on my own executables and containers - e.g. a migrator executable resource that runs
dotnet ef update
.Describe the solution you'd like
I'd like to see an API on IResourceBuilder which I can use to set the parent - e.g.
migrator.WithParent(database)
, and to have this call set on appropriate resources built in to Aspire.Additional context
I have been able to make this somewhat work with the following code, but it's very temperamental - only works about roughly 10% of the time - trying to publish resource notifications for aspire managed resources seems to be fighting with Aspire's built in orchestration.
The text was updated successfully, but these errors were encountered: