k8s: the queue's pod mounts the host unit's store in place
This commit is contained in:
parent
a793df9708
commit
140ee7f38a
1 changed files with 267 additions and 155 deletions
|
|
@ -367,7 +367,7 @@ let
|
|||
# The xkey exists only at runtime, so the server's config is rendered as
|
||||
# it starts: always the wrapper, and never the store-rendered settings
|
||||
# alone, which carry no xkey. `+` so the render may write `runtimeDir`.
|
||||
name = "the queue's server starts only through the config rendered with its xkey";
|
||||
name = "the queue's server starts only through the config rendered with its xkey, then takes its store directory back";
|
||||
ok =
|
||||
lib.all
|
||||
(
|
||||
|
|
@ -375,11 +375,17 @@ let
|
|||
let
|
||||
c = h.containers.swarm-nats.config;
|
||||
nats = c.systemd.services.nats.serviceConfig;
|
||||
pre = nats.ExecStartPre or "";
|
||||
pre = lib.toList (nats.ExecStartPre or [ ]);
|
||||
render = lib.head pre;
|
||||
in
|
||||
lib.hasSuffix "/bin/nats-server -c /var/lib/nats-callout/nats.conf" nats.ExecStart
|
||||
&& lib.hasPrefix "+/nix/store/" pre
|
||||
&& lib.hasSuffix "-swarm-nats-render-config" pre
|
||||
&& lib.hasPrefix "+/nix/store/" render
|
||||
&& lib.hasSuffix "-swarm-nats-render-config" render
|
||||
# Then the store directory goes back to the server's user, which the
|
||||
# pod, mounting it in place, leaves owned by its own.
|
||||
&& lib.length pre == 2
|
||||
&& lib.hasPrefix "+/nix/store/" (lib.elemAt pre 1)
|
||||
&& lib.hasSuffix "/bin/chown -R nats:nats /var/lib/nats" (lib.elemAt pre 1)
|
||||
&& !(c.services.nats.settings.authorization.auth_callout ? xkey)
|
||||
)
|
||||
[
|
||||
|
|
|
|||
Loading…
Reference in a new issue