Skip to content

Commit

Permalink
[release/8.0-preview2] Fix replica id trimming (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlmii authored Dec 15, 2023
1 parent c2756b4 commit 4c62776
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Aspire.Hosting/Dashboard/DashboardViewModelService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,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 4c62776

Please sign in to comment.