Watch
0
0
Fork
You've already forked hyperhive
0

read the hive collector's journald receiver as optional in the builder cases

This commit is contained in:
atlas 2026-11-01 16:15:44 +01:00 • committed by mara
commit bcc317e452

View file

@ -409,13 +409,15 @@ let
# The hive collector's journal allow-list carries the cache's init units # The hive collector's journal allow-list carries the cache's init units
# on a hive host with the cache and no swarm collector (`atticByHand`). # on a hive host with the cache and no swarm collector (`atticByHand`).
# Where the swarm collector runs too (`atticHere`) it reads the whole # Where the swarm collector runs too (`atticHere`) it reads the whole
# journal, so the units are not named twice; without the cache # journal, so no unit is named and the hive collector has no journald
# (`atticExternal`) they are absent. `hive-c0re.service` is the control # receiver; without the cache (`atticExternal`, which also runs the swarm
# that each list is the one the collector reads. # collector) the units are absent too. `hive-c0re.service` on `atticByHand`
# is the control that the lookup finds the list.
name = "the hive collector ships the cache's init units only where nothing else reads the host journal"; name = "the hive collector ships the cache's init units only where nothing else reads the host journal";
ok = ok =
let let
units = m: m.services.opentelemetry-collector.settings.receivers.journald.units; units =
m: (m.services.opentelemetry-collector.settings.receivers.journald or { units = [ ]; }).units;
initUnits = [ initUnits = [
"swarm-bao-attic-secret.service" "swarm-bao-attic-secret.service"
"swarm-bao-attic-tokens.service" "swarm-bao-attic-tokens.service"
@ -426,26 +428,23 @@ let
has atticByHand has atticByHand
&& hasNone atticHere && hasNone atticHere
&& hasNone atticExternal && hasNone atticExternal
&& lib.all (m: lib.elem "hive-c0re.service" (units m)) [ && lib.elem "hive-c0re.service" (units atticByHand);
atticByHand
atticHere
atticExternal
];
} }
{ {
# The hive collector ships the container units' start output (the rootfs # The hive collector ships the container units' start output (the rootfs
# check's lines) unless the swarm collector already reads the whole # check's lines) unless the swarm collector already reads the whole
# journal. `hive-c0re.service` is the control that the lookup finds the # journal. `hive-c0re.service` on `atticByHand` is the control that the
# list. # lookup finds the list.
name = "the hive collector ships the container units' journal only where nothing else reads the host journal"; name = "the hive collector ships the container units' journal only where nothing else reads the host journal";
ok = ok =
let let
units = m: m.services.opentelemetry-collector.settings.receivers.journald.units; units =
m: (m.services.opentelemetry-collector.settings.receivers.journald or { units = [ ]; }).units;
glob = "container@*.service"; glob = "container@*.service";
in in
lib.elem glob (units atticByHand) lib.elem glob (units atticByHand)
&& !(lib.elem glob (units atticHere)) && !(lib.elem glob (units atticHere))
&& lib.elem "hive-c0re.service" (units atticHere); && lib.elem "hive-c0re.service" (units atticByHand);
} }
{ {
# Both host units log in as the cache's principal, not the hive's, and # Both host units log in as the cache's principal, not the hive's, and