Problem
The current join token flow tests that:
- Agent registers using join token
- Join token is cleared after registration
- Agent reconnects using saved kubeconfig
But we don't test (or guarantee) that after the join token is cleared, the edge agent can be restarted (e.g. systemd restart, pod restart) and still reconnect successfully using the saved kubeconfig — without needing a new join token.
Expected Behavior
After an agent successfully registers (join token consumed, kubeconfig saved):
- Agent process stops (crash, restart, upgrade, etc.)
- Agent restarts
- Agent detects saved kubeconfig (e.g. from Secret in-cluster or file on disk)
- Agent reconnects to hub using saved kubeconfig — no join token required
- Edge transitions to connected state normally
What to implement
-
E2e test: JoinTokenEdgeRestartAfterRegistration
- Register edge via join token
- Wait for token to be cleared
- Stop the agent
- Restart agent without
--token flag
- Assert edge reconnects and becomes connected
-
Verify agent code path: when no join token is provided and a saved kubeconfig exists, agent uses the saved kubeconfig directly (not the join flow)
Related
Problem
The current join token flow tests that:
But we don't test (or guarantee) that after the join token is cleared, the edge agent can be restarted (e.g. systemd restart, pod restart) and still reconnect successfully using the saved kubeconfig — without needing a new join token.
Expected Behavior
After an agent successfully registers (join token consumed, kubeconfig saved):
What to implement
E2e test:
JoinTokenEdgeRestartAfterRegistration--tokenflagVerify agent code path: when no join token is provided and a saved kubeconfig exists, agent uses the saved kubeconfig directly (not the join flow)
Related