k8s: stt's pod runs in a user namespace of its own
This commit is contained in:
parent
02cc38d89e
commit
4e60183bfa
1 changed files with 111 additions and 26 deletions
|
|
@ -1007,6 +1007,32 @@ let
|
|||
&& sttPrune.requiredBy == [ "container@swarm-stt.service" ]
|
||||
&& lib.hasInfix "swarm-stt.yaml" sttPrune.script;
|
||||
}
|
||||
{
|
||||
# Only the speech-to-text pod is in a user namespace: every other pod is
|
||||
# the control that the field is not rendered for a service without it.
|
||||
# With the service on the host nothing asks for one, so the kernel
|
||||
# assertion is absent; with it on the cluster the assertion is there and
|
||||
# holds for the fixture's kernel.
|
||||
name = "only the speech-to-text pod runs in a user namespace, and a host with it on the cluster asserts a kernel of 6.3 or later";
|
||||
ok =
|
||||
let
|
||||
# The assertions defined in runtime.nix, found by where their message
|
||||
# is written: reading every host's messages evaluates NixOS's own,
|
||||
# which throw when their condition holds.
|
||||
userns =
|
||||
c:
|
||||
lib.filter (
|
||||
a: lib.hasSuffix "/k8s/runtime.nix" (builtins.unsafeGetAttrPos "message" a).file
|
||||
) c.assertions;
|
||||
in
|
||||
(podSpec "swarm-stt").hostUsers == false
|
||||
&& lib.all (n: !((podSpec n) ? hostUsers)) (lib.filter (n: n != "swarm-stt") (lib.attrNames units))
|
||||
&& withNode.services.hyperhive.k8s.rendered.userNamespaces == [ "swarm-stt" ]
|
||||
&& userns withNode == [ ]
|
||||
&& lib.length (userns onCluster) == 1
|
||||
&& (lib.head (userns onCluster)).assertion
|
||||
&& lib.versionAtLeast onCluster.boot.kernelPackages.kernel.version "6.3";
|
||||
}
|
||||
{
|
||||
# The unit's ceilings are the pod's limits and reserve nothing, and the
|
||||
# limits the pod has no field for are not rendered. The controller's pod,
|
||||
|
|
|
|||
Loading…
Reference in a new issue