Watch
0
0
Fork
You've already forked hyperhive
0

k8s-nats-switch: set the default namespace again after a switch restarts k3s

This commit is contained in:
atlas 2026-11-25 22:00:05 +01:00 • committed by mara
commit 9d9757c153

View file

@ -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