Skip to content

Commit

Permalink
Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Feb 26, 2024
1 parent 57f2f63 commit 0ac3e2c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public partial class EndpointsColumnDisplay
[Parameter, EditorRequired]
public required bool HasMultipleReplicas { get; set; }

/// <summary>
/// A resource has services and endpoints. These can overlap. This method attempts to return a single list without duplicates.
/// </summary>
private static List<DisplayedEndpoint> GetEndpoints(ResourceViewModel resource, bool excludeServices = false)
{
var displayedEndpoints = new List<DisplayedEndpoint>();
Expand Down Expand Up @@ -43,6 +46,7 @@ private static List<DisplayedEndpoint> GetEndpoints(ResourceViewModel resource,
throw new InvalidOperationException($"Couldn't parse '{endpoint.ProxyUrl}' to a URI.", ex);
}

// There isn't a good way to match services and endpoints other than by address and port.
var existingMatches = displayedEndpoints.Where(e => string.Equals(e.Address, uri.Host, StringComparisons.UrlHost) && e.Port == uri.Port).ToList();

if (existingMatches.Count > 0)
Expand Down

0 comments on commit 0ac3e2c

Please sign in to comment.