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