glue: consumers' start-after-bao ordering moves into one glue module
Each store reader (forge's OIDC fetch and token publisher, matrix's OIDC fetch, the hive collector's fetch, Grafana's OIDC fetch and admin password, the queue's callout-xkey unit, the CI runner's token fetch, the swarm collector's OIDC fetch) used to read `deploy.bao.enable` in its own module to add `after`/`wants` on `container@<store machine>` and `after`/`requires` on `swarm-bao-pki.service`. Per the #3742 ruling, that cross-service read moves into glue-bao-readers-store-order.nix, which sets the same edges when the store and the reader are both on this host and restates each reader's own gate so no stub unit is rendered. Rendered `after`/`wants`/`requires` are identical as sets to main on 16 fixtures, store here and elsewhere. New module-eval cases in existing fixtures pin both arms. Part of #3742.
This commit is contained in:
parent
40ebd45c66
commit
9407db69b5
13 changed files with 198 additions and 76 deletions
|
|
@ -278,6 +278,26 @@ let
|
|||
in
|
||||
lib.hasInfix "bao kv get -field=value ${path}" fetch && lib.hasInfix "bao kv put ${path} " publish;
|
||||
}
|
||||
{
|
||||
# The store's units exist only on its host; `Requires=` on an absent one
|
||||
# fails the fetch's start.
|
||||
name = "the hive collector's fetch waits for the store's container and PKI unit only where the store runs here";
|
||||
ok =
|
||||
let
|
||||
storeUnits = m: [
|
||||
"swarm-bao-pki.service"
|
||||
"container@${m.services.hyperhive.swarm.bao.machine}.service"
|
||||
];
|
||||
here = hiveOtelFetch hiveOtelAllLocal;
|
||||
elsewhere = hiveOtelFetch hiveOtelLeaf;
|
||||
in
|
||||
lib.all (n: lib.elem n here.after) (storeUnits hiveOtelAllLocal)
|
||||
&& lib.elem "swarm-bao-pki.service" here.requires
|
||||
&& lib.elem "container@${hiveOtelAllLocal.services.hyperhive.swarm.bao.machine}.service" here.wants
|
||||
&& !(lib.any (n: lib.elem n (elsewhere.after ++ elsewhere.wants ++ elsewhere.requires)) (
|
||||
storeUnits hiveOtelLeaf
|
||||
));
|
||||
}
|
||||
{
|
||||
# A secret delivered some other way is the operator's: no unit fetches
|
||||
# into a file the collector does not load, or restarts it on one. Nothing
|
||||
|
|
|
|||
Loading…
Reference in a new issue