From c42935bd1dab6288304a078cb8316df0fc6f2ced Mon Sep 17 00:00:00 2001 From: atlas Date: Sat, 28 Nov 2026 01:41:17 +0100 Subject: [PATCH] stop the dashboard subtests overwriting the driver's pod() The subtest that reads the Grafana pod's spec assigned it to `pod`, which is the name of lib/k3s.py's pod(); the next wait_pod() call, after the pod delete, died with "'dict' object is not callable". --- nix/vm-tests/k8s-services.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/vm-tests/k8s-services.nix b/nix/vm-tests/k8s-services.nix index affed5bed..0ef804a65 100644 --- a/nix/vm-tests/k8s-services.nix +++ b/nix/vm-tests/k8s-services.nix @@ -1779,16 +1779,16 @@ pkgs.testers.runNixOSTest { grafana_pod = wait_pod_ready(GRAFANA, timeout=900) with subtest("the dashboard's init container fetched its secrets, its sidecar runs, and the pod mounts no store's credential"): - pod = json.loads(kube(machine, f"get pod {grafana_pod} -o json")) - init = pod["status"]["initContainerStatuses"] + grafana_spec = json.loads(kube(machine, f"get pod {grafana_pod} -o json")) + init = grafana_spec["status"]["initContainerStatuses"] assert [c["name"] for c in init] == ["fetch-secrets"] and init[0]["state"]["terminated"]["exitCode"] == 0, init - running = {c["name"]: c for c in pod["status"]["containerStatuses"]} + running = {c["name"]: c for c in grafana_spec["status"]["containerStatuses"]} assert set(running) == {GRAFANA, "controller-token"}, running.keys() assert all(c["ready"] and "running" in c["state"] for c in running.values()), running # The pod mounts the one Secret of its own listener's credential and # none of the two stores', which it reaches through the gateway with # its bearer; the values it fetched are in no container's log. - secrets = {v["secret"]["secretName"] for v in pod["spec"]["volumes"] if "secret" in v} + secrets = {v["secret"]["secretName"] for v in grafana_spec["spec"]["volumes"] if "secret" in v} assert secrets <= {"swarm-grafana-credentials"}, secrets stored = as_root("bao kv get -mount=secret -field=value swarm/services/grafana/store-auth").strip() for name in (GRAFANA, "controller-token"):