A standby's admin API is the leader's
The console and ctl on a standby showed its own empty view: nodes and replicas live in the leader's memory. A standby now passes /api/ to the leader over the agent port, with the cluster's certificates both ways; the leader answers only a certificate naming a control plane the store lists, and only while it leads. Control plane certificates are issued for client use as well, and server add reissues older ones. An agent's reconnect backoff starts again after a session that worked, so each failover it lives through no longer makes the next one slower. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
adef25d709
commit
1d1409faad
12 files changed
+510
-13
No files matched your search
@@ -203,3 +203,18 @@ func TestTheConsoleAddsAControlPlaneWithAFloatingAddress(t *testing.T) {
|
||||
t.Errorf("dialog %q: %s", c.dialog, c.dialogText)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTheConsoleOnAStandbySaysWhoseClusterItShows(t *testing.T) {
|
||||
m := consoleModel{menu: cOverview, loaded: true, width: 120, height: 40}
|
||||
m.data.sum.ControlPlanes = adminapi.ControlPlanes{Members: []adminapi.ControlPlane{
|
||||
{Name: "llmgw-ctl", State: "leading"},
|
||||
{Name: "llmgw-ctl02", State: "standing by", This: true},
|
||||
}}
|
||||
if v := m.View(); !strings.Contains(v, "Standing by. Shown, and changed, on the leader: llmgw-ctl") {
|
||||
t.Errorf("the overview on a standby:\n%s", v)
|
||||
}
|
||||
m.data.sum.ControlPlanes.Members[0].This, m.data.sum.ControlPlanes.Members[1].This = true, false
|
||||
if v := m.View(); strings.Contains(v, "Standing by.") {
|
||||
t.Error("the leader's console says it is standing by")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user