Skip to content

Commit

Permalink
Fix replica id trimming (#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlmii committed Dec 15, 2023
1 parent f955331 commit 1a3d6e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Aspire.Hosting/Dashboard/DcpDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,11 @@ private static string ComputeExecutableDisplayName(Executable executable)
);
if (replicaSetOwner is not null && displayName.Length > 3)
{
var nameParts = displayName.Split('-');
if (nameParts.Length == 2 && nameParts[0].Length > 0 && nameParts[1].Length > 0)
var lastHyphenIndex = displayName.LastIndexOf('-');
if (lastHyphenIndex > 0 && lastHyphenIndex < displayName.Length - 1)
{
// Strip the replica ID from the name.
displayName = nameParts[0];
displayName = displayName[..lastHyphenIndex];
}
}
return displayName;
Expand Down

0 comments on commit 1a3d6e6

Please sign in to comment.