Watch
0
0
Fork
You've already forked hyperhive
0

force each container's unit configs in the checks about it

This commit is contained in:
atlas 2026-10-25 20:48:42 +01:00 • committed by mara
commit 549c198449
6 changed files with 46 additions and 16 deletions

View file

@ -253,6 +253,21 @@ let
"echo 'module-eval-${name}: ${toString (builtins.length bad)} of ${toString (builtins.length cases)} properties broke' >&2 && exit 1"
}
'';
# `serviceConfig` is an `attrsOf`: each key merges lazily, and a priority
# collision throws only when that key is demanded. A check reading
# `LoadCredential` therefore says nothing about `Restart`. Takes one
# container's `config`; `true` once every unit's every `serviceConfig` value
# is at WHNF. `seq` per value, not `deepSeq`: walking into a derivation-shaped
# value's `override` self-reference overflows the stack.
forceServiceConfigs =
containerCfg:
let
vals = lib.concatMap (s: builtins.attrValues (s.serviceConfig or { })) (
builtins.attrValues containerCfg.systemd.services
);
in
builtins.foldl' (acc: v: builtins.seq v acc) true vals;
in
{
inherit hive;
@ -272,4 +287,5 @@ in
inherit carriesJournaldSeverity;
inherit swarmServiceEnables;
inherit runGroup;
inherit forceServiceConfigs;
}