Watch
0
0
Fork
You've already forked hyperhive
0

module-eval: assert every removed callout option fails in both namespaces

The removal case set 6 of the 10 option x namespace pairs. Build the pairs
from one option table over both namespaces and check there are 10.
This commit is contained in:
atlas 2026-10-06 11:58:25 +02:00 • committed by mara
commit c3ef18ad09

View file

@ -377,16 +377,30 @@ let
&& lib.hasInfix "services.hyperhive.${path}" a.message && lib.hasInfix "services.hyperhive.${path}" a.message
&& lib.hasInfix "live in the swarm secret store" a.message && lib.hasInfix "live in the swarm secret store" a.message
) m.assertions; ) m.assertions;
setting = { removedOptions = {
"deploy.nats.autoGenerateCallout" = hive { deploy.nats.autoGenerateCallout = true; }; autoGenerateCallout = true;
"swarm.nats.autoGenerateCallout" = hive { swarm.nats.autoGenerateCallout = true; }; calloutUserPublicKey = "U";
"deploy.nats.calloutUserPublicKey" = hive { deploy.nats.calloutUserPublicKey = "U"; }; calloutIssuerPublicKey = "A";
"deploy.nats.calloutIssuerPublicKey" = hive { deploy.nats.calloutIssuerPublicKey = "A"; }; calloutUserSeedFile = "/run/u.seed";
"deploy.nats.calloutUserSeedFile" = hive { deploy.nats.calloutUserSeedFile = "/run/u.seed"; }; calloutIssuerSeedFile = "/run/i.seed";
"swarm.nats.calloutIssuerSeedFile" = hive { swarm.nats.calloutIssuerSeedFile = "/run/i.seed"; };
}; };
setting = lib.listToAttrs (
lib.concatMap
(
ns:
lib.mapAttrsToList (name: value: {
name = "${ns}.nats.${name}";
value = hive { ${ns}.nats.${name} = value; };
}) removedOptions
)
[
"deploy"
"swarm"
]
);
in in
lib.all (path: refused setting.${path} path) (lib.attrNames setting) lib.length (lib.attrNames setting) == 10
&& lib.all (path: refused setting.${path} path) (lib.attrNames setting)
&& !(lib.any (path: refused natsWithStoreIdentity path) (lib.attrNames setting)); && !(lib.any (path: refused natsWithStoreIdentity path) (lib.attrNames setting));
} }
{ {