826312befe
Clears CommentChecker findings in src/ (3,280 -> 209, the remainder being false positives like PLC-5/IEEE-754/M0.0) by adding missing summaries/params/returns, normalising inheritdoc usage, and removing Gitea/review tracking IDs while keeping the rationale they annotated. Comment-only: comment-stripped sources are identical to the parent commit.
31 lines
1.4 KiB
C#
31 lines
1.4 KiB
C#
using ZB.MOM.WW.OtOpcUa.Cluster;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.Host.Configuration;
|
|
|
|
/// <summary>
|
|
/// Names the per-role appsettings overlay (<c>appsettings.{suffix}.json</c>) for a node.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The suffix is built from the node's PLAIN roles only. <c>cluster-{ClusterId}</c> roles are mesh-membership
|
|
/// tags (and carry a verbatim, operator-chosen ClusterId), not configuration profiles — folding one into the
|
|
/// filename produced names like <c>appsettings.admin-cluster-MAIN-driver.json</c> that never exist, so on every
|
|
/// node with a cluster role the shipped overlays silently never loaded.
|
|
/// </remarks>
|
|
internal static class RoleOverlay
|
|
{
|
|
/// <summary>
|
|
/// The overlay filename suffix: the plain (non-cluster) roles, ordinal-sorted and joined with <c>-</c>, or
|
|
/// <see langword="null"/> when the node has none.
|
|
/// </summary>
|
|
/// <param name="gossipedRoles">The roles gossiped for this node.</param>
|
|
/// <returns>The suffix, or <see langword="null"/> when the node has no plain roles.</returns>
|
|
public static string? Suffix(IReadOnlyList<string> gossipedRoles)
|
|
{
|
|
var plain = gossipedRoles
|
|
.Where(r => !string.IsNullOrWhiteSpace(r) && !RoleParser.IsClusterRole(r))
|
|
.OrderBy(r => r, StringComparer.Ordinal)
|
|
.ToList();
|
|
return plain.Count == 0 ? null : string.Join('-', plain);
|
|
}
|
|
}
|