From ae6128848a738712411ecf84b68e9ff2b2e5befc Mon Sep 17 00:00:00 2001 From: atlas Date: Wed, 25 Nov 2026 22:00:05 +0100 Subject: [PATCH] k8s-nats-switch: set the default namespace again after a switch restarts k3s --- nix/vm-tests/k8s-nats-switch.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nix/vm-tests/k8s-nats-switch.nix b/nix/vm-tests/k8s-nats-switch.nix index 03994aa2a..0f5719001 100644 --- a/nix/vm-tests/k8s-nats-switch.nix +++ b/nix/vm-tests/k8s-nats-switch.nix @@ -466,6 +466,10 @@ pkgs.testers.runNixOSTest { failed = next((line for line in out.splitlines() if "the following units failed" in line), "") ours = [HOST_UNIT, f"{PRUNE}.service", "hyperhive-k8s-ca-trust.service", "k3s.service", "firewall.service"] assert not any(unit in failed for unit in ours), failed + # k3s writes its kubeconfig again when it restarts, which a switch that + # changes the node's flags does, and with it drops the default namespace. + machine.wait_until_succeeds("kubectl get --raw /readyz", timeout=300) + kube(machine, f"config set-context --current --namespace={NS}") return out