Watch
0
0
Fork
You've already forked hyperhive
0

swarm-nats: order the host queue's callout-key unit after the prune

A switch back deletes the queue's pod with --wait, so the pod is still
ending while swarm-nats-k8s-prune runs. swarm-bao-nats-callout-xkey was
ordered before the container but not after the prune, so on a slow
apiserver its ensure-callout-keys ran beside the pod's responder and the
switch test saw two responders. On a host with the cluster node the unit
now starts after the prune. The prune names the unit nowhere, so there is
no cycle, and without the node nothing changes.

Closes #6831
This commit is contained in:
maia 2026-11-24 08:49:21 +01:00
commit f658b2c770

View file

@ -1910,6 +1910,23 @@ let
&& (u onCluster).environment == (u withNode).environment
&& (u onCluster).serviceConfig.LoadCredential == (u withNode).serviceConfig.LoadCredential;
}
{
# A switch back deletes the queue's pod with `--wait`, so the pod is
# still ending while the prune runs. The host copy's key step must wait
# for the prune, or it runs beside the pod's responder; and the prune must
# not name the key unit, which would be a cycle. Without the node there is
# no prune, so nothing orders the key unit after one.
name = "the host queue's callout-key unit starts after the prune that waits for the queue's pod, and the prune does not name it";
ok =
let
xkey = withNode.systemd.services.swarm-bao-nats-callout-xkey;
prune = withNode.systemd.services.swarm-nats-k8s-prune;
names = u: u.after ++ u.before ++ u.requires ++ u.wants ++ u.requiredBy ++ u.wantedBy;
in
lib.elem "swarm-nats-k8s-prune.service" xkey.after
&& !(lib.elem "swarm-bao-nats-callout-xkey.service" (names prune))
&& !(lib.elem "swarm-nats-k8s-prune.service" allLocal.systemd.services.swarm-bao-nats-callout-xkey.after);
}
{
# The host with the queue on it is the control for each absence: it has
# the container, both delivery units and no rule in the raw table.