Watch
0
0
Fork
You've already forked hyperhive
0

glue: the controller's authelia and otel environment moves out of the controller module

The authelia and swarm-otel co-location reads (swarm-controller.nix
autheliaEnv, otelEnv) move into glue-controller-env.nix.
This commit is contained in:
atlas 2026-10-13 08:43:09 +02:00 • committed by mara
commit 1219091788
9 changed files with 115 additions and 69 deletions

View file

@ -145,6 +145,38 @@ let
name = "the all-local mode turns the swarm controller on";
ok = allLocal.services.hyperhive.deploy.swarm-controller.enable;
}
{
# ../host-modules/glue-controller-env.nix: the collector's coordinates
# follow swarm-otel running HERE. `controllerAlone` is the split case — a
# controller whose collector runs elsewhere.
name = "the controller exports to the collector only where the collector runs here";
ok =
let
env = m: m.systemd.services.swarm-controller.environment;
otel = allLocal.services.hyperhive.swarm.otel;
in
(env allLocal).OTEL_EXPORTER_OTLP_ENDPOINT or null == "https://${otel.domain}/${otel.producerName}"
&&
(env allLocal).SWARM_CONTROLLER_OTEL_AUDIENCE or null
== allLocal.services.hyperhive.swarm.controller.queueClientId
&& !(env shared.controllerAlone ? OTEL_EXPORTER_OTLP_ENDPOINT)
&& !(env shared.controllerAlone ? SWARM_CONTROLLER_OTEL_AUDIENCE);
}
{
# Same file: `swarmctl` is told where the configured authelia is only
# where authelia runs here.
name = "swarmctl is given the authelia binary and users file only where authelia runs here";
ok =
let
env = m: m.services.hyperhive.deploy.swarm-controller.swarmctlEnvironment;
d = allLocal.services.hyperhive.deploy.authelia;
in
env allLocal == {
SWARMCTL_AUTHELIA_BIN = "${d.package}/bin/authelia";
SWARMCTL_AUTHELIA_USERS_FILE = d.hostUsersFile;
}
&& env shared.controllerAlone == { };
}
{
# Where the reader puts the files and where the daemon looks for them is
# one agreement spanning two modules. Asserted against the option rather