From 58e59be65e6d13c368bf7bd172fd3d49a40d4c8c Mon Sep 17 00:00:00 2001 From: atlas Date: Mon, 23 Nov 2026 20:17:43 +0100 Subject: [PATCH] vm-tests: k8s-bao-login expects the roles the module names The test listed three jwt roles by hand, and the store has eight since the queue, stt, the review classifier and the claude minter joined, so it failed at the role assertion before it reached any pod. The list is now the module's own k8sPrincipals, sorted. --- nix/vm-tests/k8s-bao-login.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nix/vm-tests/k8s-bao-login.nix b/nix/vm-tests/k8s-bao-login.nix index 133b7fa12..464350a9e 100644 --- a/nix/vm-tests/k8s-bao-login.nix +++ b/nix/vm-tests/k8s-bao-login.nix @@ -201,6 +201,10 @@ pkgs.testers.runNixOSTest { config.system.build.k8sImages ++ [ probeImage ] ); "k8s-bao/manifests".source = config.system.build.k8sManifests; + # The jwt roles the store has: one per in-cluster principal the module names. + "k8s-bao/in-cluster.json".text = builtins.toJSON ( + lib.sort lib.lessThan config.services.hyperhive.deploy.bao.k8sPrincipals + ); "k8s-bao/pod-right.json".text = builtins.toJSON (probePod "right" service tokenVolume); "k8s-bao/pod-intruder.json".text = builtins.toJSON (probePod "intruder" "intruder" tokenVolume); "k8s-bao/pod-audience.json".text = builtins.toJSON (probePod "audience" service otherAudience); @@ -236,7 +240,7 @@ pkgs.testers.runNixOSTest { CONTROL_PORT = ${toString controlPort} API = f"https://${baoName}:{POD_PORT}" ISSUER = "https://kubernetes.default.svc.cluster.local" - IN_CLUSTER = ["swarm-ci-metrics", "swarm-controller", "swarm-notify-router"] + IN_CLUSTER = json.loads(machine.succeed("cat /etc/k8s-bao/in-cluster.json")) def as_root(command: str) -> str: