containers reach network-online only with a dhcp lease, and bao users wait for it
This commit is contained in:
parent
04f8683f99
commit
81a57a9f81
1 changed files with 77 additions and 3 deletions
|
|
@ -223,6 +223,30 @@ let
|
|||
in
|
||||
lib.hasInfix "bao kv get -format=json ${arg} >\"$raw\"" (agentBaoIdentity m).script;
|
||||
}
|
||||
{
|
||||
# dhcpcd without IPv4LL waiting for IPv4 makes `network-online` a lease,
|
||||
# and the two units that dial the store at start order after it. The
|
||||
# trust bundle's order after the identity check and `nohook` are the
|
||||
# controls that the lookups find something.
|
||||
name = "an agent reaches network-online only with a lease, and its store identity and trust bundle wait for it";
|
||||
ok =
|
||||
let
|
||||
d = agentBao.networking.dhcpcd;
|
||||
after = n: agentBao.systemd.services.${n}.after;
|
||||
wants = n: agentBao.systemd.services.${n}.wants;
|
||||
units = [
|
||||
"hive-agent-bao-identity"
|
||||
"hive-agent-trust-bundle"
|
||||
];
|
||||
in
|
||||
lib.hasInfix "noipv4ll" d.extraConfig
|
||||
&& lib.hasInfix "nohook resolv.conf" d.extraConfig
|
||||
&& d.wait == "ipv4"
|
||||
&& lib.elem "hive-agent-bao-identity.service" (after "hive-agent-trust-bundle")
|
||||
&& lib.all (
|
||||
n: lib.elem "network-online.target" (after n) && lib.elem "network-online.target" (wants n)
|
||||
) units;
|
||||
}
|
||||
{
|
||||
# The absence arm, and what makes the four above able to fail. An agent
|
||||
# whose swarm never minted an identity has nothing to log in with, and a
|
||||
|
|
|
|||
Loading…
Reference in a new issue