Watch
0
0
Fork
You've already forked hyperhive
0

containers reach network-online only with a dhcp lease, and bao users wait for it

This commit is contained in:
atlas 2026-11-01 11:06:41 +01:00
commit 81a57a9f81

View file

@ -295,6 +295,31 @@ let
&& !(sc.DynamicUser or false)
&& swarmServicesHere.services.hyperhive.deploy.nats.enable;
}
{
# dhcpcd without IPv4LL, waiting for IPv4: `network-online` is a lease.
# The router sets no `nohook` itself and authelia does; `nohook` is the
# control that the lookup finds `extraConfig`. The queue shares the host
# netns and keeps the default.
name = "private-netns service containers wait for a DHCP lease and the forwarder fetch waits for it";
ok =
let
cfgOf = name: swarmServicesHere.containers.${name}.config;
leased =
name:
let
d = (cfgOf name).networking.dhcpcd;
in
lib.hasInfix "noipv4ll" d.extraConfig && d.wait == "ipv4";
fetch = (cfgOf "swarm-builder").systemd.services.swarm-journal-forwarder-oidc;
in
leased "swarm-notify-router"
&& leased "swarm-authelia"
&& lib.hasInfix "nohook resolv.conf" (cfgOf "swarm-authelia").networking.dhcpcd.extraConfig
&& !(lib.hasInfix "noipv4ll" (cfgOf "swarm-nats").networking.dhcpcd.extraConfig)
&& (cfgOf "swarm-nats").networking.dhcpcd.wait == "any"
&& lib.elem "network-online.target" fetch.after
&& lib.elem "network-online.target" fetch.wants;
}
{
name = "the notification router stays off where the shared services are hosted without the store";
ok =