Watch
0
0
Fork
You've already forked hyperhive
0

remove the old snapshot store; tombstone its options

This commit is contained in:
atlas 2026-11-09 23:13:18 +01:00 • committed by mara
commit 20d286f06a

View file

@ -2049,6 +2049,43 @@ let
})
&& !(refused allLocal);
}
{
# One host defining all five removed paths. Each message names its own
# path (`services.hyperhive.swarm.snapshotStore.port` does not contain
# `services.hyperhive.snapshotStore.port`), so each lookup finds only
# its option. The control is a host that defines none.
name = "a definition of a removed snapshot store option fails evaluation, naming the option and swarm-archive";
ok =
let
paths = [
"swarm.snapshotStore.address"
"swarm.snapshotStore.port"
"snapshotStore.enable"
"snapshotStore.path"
"snapshotStore.port"
];
refused =
m: path:
lib.any (
a:
!a.assertion
&& lib.hasInfix "services.hyperhive.${path}" a.message
&& lib.hasInfix "agent-state backups are being rebuilt as swarm-archive" a.message
) m.assertions;
old = hive {
swarm.snapshotStore = {
address = "10.100.0.1";
port = 51821;
};
snapshotStore = {
enable = true;
path = "/var/lib/hyperhive-snapshots";
port = 51821;
};
};
in
lib.all (path: refused old path) paths && !(lib.any (path: refused bare path) paths);
}
{
# Refused wherever any hyperhive service runs, the hive or a swarm
# service alone. The host enabling nothing is the control that it is