forked from dotnet/aspire
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow start command to force waiting resources to start (dotnet#7312)
- Loading branch information
Showing
9 changed files
with
182 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Aspire.Hosting.ApplicationModel; | ||
using Aspire.Hosting.Dcp.Model; | ||
using System.Diagnostics; | ||
|
||
namespace Aspire.Hosting.Dcp; | ||
|
||
[DebuggerDisplay("ModelResource = {ModelResource}, DcpResourceName = {DcpResourceName}")] | ||
internal class AppResource : IResourceReference | ||
{ | ||
public IResource ModelResource { get; } | ||
public CustomResource DcpResource { get; } | ||
public string DcpResourceName => DcpResource.Metadata.Name; | ||
public virtual List<ServiceAppResource> ServicesProduced { get; } = []; | ||
public virtual List<ServiceAppResource> ServicesConsumed { get; } = []; | ||
|
||
public AppResource(IResource modelResource, CustomResource dcpResource) | ||
{ | ||
ModelResource = modelResource; | ||
DcpResource = dcpResource; | ||
} | ||
} | ||
|
||
internal sealed class ServiceAppResource : AppResource | ||
{ | ||
public Service Service => (Service)DcpResource; | ||
public EndpointAnnotation EndpointAnnotation { get; } | ||
|
||
public override List<ServiceAppResource> ServicesProduced | ||
{ | ||
get { throw new InvalidOperationException("Service resources do not produce any services"); } | ||
} | ||
public override List<ServiceAppResource> ServicesConsumed | ||
{ | ||
get { throw new InvalidOperationException("Service resources do not consume any services"); } | ||
} | ||
|
||
public ServiceAppResource(IResource modelResource, Service service, EndpointAnnotation sba) : base(modelResource, service) | ||
{ | ||
EndpointAnnotation = sba; | ||
} | ||
} | ||
|
||
internal interface IResourceReference | ||
{ | ||
IResource ModelResource { get; } | ||
string DcpResourceName { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters