nix: the bash daemon gets the agent's store identity so it can publish its tasks
This commit is contained in:
parent
4a554fd6bf
commit
1302965ca7
1 changed files with 53 additions and 12 deletions
|
|
@ -114,6 +114,30 @@ let
|
|||
# Control: the lookup finds the store identity's credential.
|
||||
&& lib.elem "hive-agent-bao-server-ca" (credentials agentBao);
|
||||
}
|
||||
{
|
||||
# The bash daemon publishes each task to the queue as the agent, which
|
||||
# takes the agent's name and store identity in its own environment; the
|
||||
# swarm UI's background-tasks list is empty without them. Same
|
||||
# identity and server CA as the subagent daemon, ordered after the
|
||||
# login unit that writes the certificate.
|
||||
name = "the bash daemon gets the agent's store identity to publish its tasks";
|
||||
ok =
|
||||
let
|
||||
a = agentBao.services.hyperhive.agent;
|
||||
u = agentBao.systemd.services.hive-bash-daemon;
|
||||
e = u.environment;
|
||||
in
|
||||
e.HIVE_AGENT_NAME == a.user.name
|
||||
&& e.BAO_ADDR == a.bao.addr
|
||||
&& e.BAO_CLIENT_CERT == a.bao.clientCertFile
|
||||
&& e.BAO_CLIENT_KEY == a.bao.clientKeyFile
|
||||
&& e.BAO_CACERT == "%d/hive-agent-bao-server-ca"
|
||||
&& lib.elem "hive-agent-bao-server-ca" u.serviceConfig.LoadCredential
|
||||
&& lib.elem "hive-agent-bao-identity.service" u.after
|
||||
# Control: with no store address the daemon names no identity.
|
||||
&& !(agentNoBao.systemd.services.hive-bash-daemon.environment ? BAO_ADDR)
|
||||
&& !(agentNoBao.systemd.services.hive-bash-daemon.serviceConfig ? LoadCredential);
|
||||
}
|
||||
{
|
||||
# Both options are refused, naming where the address
|
||||
# comes from now, rather than dropped silently.
|
||||
|
|
|
|||
Loading…
Reference in a new issue