force each container's unit configs in the checks about it
This commit is contained in:
parent
4cdf807afc
commit
549c198449
6 changed files with 46 additions and 16 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue