refactor(registry): simplify stable uid validation message
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
concatStringsSep
|
|
||||||
foldl'
|
foldl'
|
||||||
groupBy
|
groupBy
|
||||||
unique
|
unique
|
||||||
@@ -25,8 +24,6 @@ let
|
|||||||
acc
|
acc
|
||||||
) [ ] (builtins.attrNames byUid);
|
) [ ] (builtins.attrNames byUid);
|
||||||
|
|
||||||
renderUidConflict = conflict:
|
|
||||||
"${toString conflict.uid} is assigned to ${concatStringsSep ", " conflict.serviceNames}";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# Next stable UID: 20003
|
# Next stable UID: 20003
|
||||||
@@ -41,9 +38,7 @@ in
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
assertion = uidConflicts == [ ];
|
assertion = uidConflicts == [ ];
|
||||||
message = ''
|
message = "Stable UID allocations must be unique.";
|
||||||
Duplicate stable UID allocation(s): ${concatStringsSep "\n" (map renderUidConflict uidConflicts)}
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user