swarm: move both metric stores' package to deploy, and cover their shims
Same rule as matrix and grafana: which build a service runs is a decision of the host that runs it. Both stores already had a `deploy.<store>` option for retention, so the package joins something rather than opening a namespace. The prose in both modules claimed the package as part of "what the store IS from any hive's point of view" — a client hive needs the domain and the port to reach a store, never the build it runs. deploy.nix's own comment made the same claim about the pair and is corrected with them. Separately, and the reason this commit adds a fixture rather than a line: NEITHER STORE HAD AN OLD-PATH FIXTURE AT ALL. `swarm.victorialogs.` and `swarm.victoriametrics.` had zero hits in module-eval.nix, so the `enable` shims from the first slice and both `retentionPeriod` shims have been uncovered since they landed — the suite would have gone green with any of them deleted. That is precisely what the wireguard fixture's own comment warns about: a missing shim reads as a clean tree and breaks every existing operator config. `storesOldPath` therefore sets all six old paths, not just the two this commit moves. The case reads the package the CONTAINER renders rather than the option, so a shim that resolves but stops reaching the module fails too. Refs #3772.
This commit is contained in:
parent
0002c15dc3
commit
e091add37a
4 changed files with 61 additions and 24 deletions
|
|
@ -154,6 +154,20 @@ let
|
|||
swarm.controller.queue.clientSecretFile = "/run/secrets/ctrl-queue.secret";
|
||||
};
|
||||
|
||||
# The two stores, which had NO old-path fixture at all until this slice —
|
||||
# their `enable` and `retentionPeriod` shims have been uncovered since they
|
||||
# landed, which is precisely the "a missing shim reads as a clean tree"
|
||||
# failure ./module-eval.nix's wireguard fixture was written to catch. All six
|
||||
# old paths are set, so dropping any single entry fails the eval.
|
||||
storesOldPath = hive {
|
||||
swarm.victoriametrics.enable = true;
|
||||
swarm.victorialogs.enable = true;
|
||||
swarm.victoriametrics.retentionPeriod = "3d";
|
||||
swarm.victorialogs.retentionPeriod = "5d";
|
||||
swarm.victoriametrics.package = pkgs.emptyDirectory;
|
||||
swarm.victorialogs.package = pkgs.emptyDirectory;
|
||||
};
|
||||
|
||||
grafanaOldPath = hive {
|
||||
deploy.grafana.enable = true;
|
||||
swarm.grafana.socketDir = "/run/test-grafana-sock";
|
||||
|
|
@ -476,6 +490,18 @@ let
|
|||
# host-side half depends on: no store here, so no bind mount and no unit.
|
||||
# Without it a hive that merely names a token would drag the store's
|
||||
# container config into its evaluation.
|
||||
# Reads the package the CONTAINER renders, not the option: a shim that
|
||||
# resolves but stops reaching the module would leave the store running
|
||||
# nixpkgs' default while the operator's override read back fine.
|
||||
name = "a config written against the pre-rename store paths still picks the operator's package";
|
||||
ok =
|
||||
storesOldPath.containers.swarm-victorialogs.config.services.victorialogs.package
|
||||
== pkgs.emptyDirectory
|
||||
&&
|
||||
storesOldPath.containers.swarm-victoriametrics.config.services.victoriametrics.package
|
||||
== pkgs.emptyDirectory;
|
||||
}
|
||||
{
|
||||
name = "a bootstrap token on a host that runs no store grants nothing";
|
||||
ok = !(baoGrantNoStore.systemd.services ? swarm-bao-bootstrap-dir);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue