k8s: a pod's public CA files come from a ConfigMap, not a Secret
This commit is contained in:
parent
15eccc1f3b
commit
485da0c3c7
1 changed files with 104 additions and 22 deletions
|
|
@ -205,6 +205,32 @@ let
|
|||
&&
|
||||
(lib.head (podSpec "swarm-controller").volumes).secret.secretName == "swarm-controller-credentials";
|
||||
}
|
||||
{
|
||||
# The controller's pod is the control for the Secret lookup: its
|
||||
# credentials still come from one.
|
||||
name = "the router's CA file comes from the CA ConfigMap and its pod mounts no Secret";
|
||||
ok =
|
||||
let
|
||||
volumes = (podSpec "swarm-notify-router").volumes;
|
||||
credentials = lib.findFirst (v: v.name == "credentials") null volumes;
|
||||
sources = credentials.projected.sources;
|
||||
in
|
||||
credentials != null
|
||||
&& lib.length sources == 1
|
||||
&& (lib.head sources).configMap.name == "hyperhive-ca-trust"
|
||||
&&
|
||||
map (i: [
|
||||
i.key
|
||||
i.path
|
||||
]) (lib.head sources).configMap.items == [
|
||||
[
|
||||
"bao-server-ca.pem"
|
||||
"notify-router-bao-server-ca"
|
||||
]
|
||||
]
|
||||
&& !(lib.any (v: v ? secret) volumes)
|
||||
&& lib.any (v: v ? secret) (podSpec "swarm-controller").volumes;
|
||||
}
|
||||
{
|
||||
name = "the poller's CronJob runs on its timer's interval and deadline, never overlapping";
|
||||
ok =
|
||||
|
|
|
|||
Loading…
Reference in a new issue