Fleet public routes review R1 finding 2: C08 reads the edge's own fleet-dispatch answer
forwardHeldReason treated every forward row as satisfactory and admitted a legacy row on app, region and raw account alone: a partial copy of the fleet arm's decision. A legacy row sent down its own Tunnel, one refused because the fleet's owner is another account, one not ready, a sidecar, and a forward row of another app or fleet left in a collision all hid the held-host reason. FleetArmVerdict now also returns Served: every host the fleet arm serves, with its fleet, its app and the account it is served for (the fleet's owner, which eligibility matched the row's account to; an accountless row is served for the owner). Reload's two fleet cases take their fleet from Served and nothing else reaches a fleet's tunnel, so Served is what Reload dispatches by construction; an admitted forward row that is somehow not Served is never served by another arm. The console builds the verdict over the same listing and its registry's fleets table (its box is the hub, plan ruling P-3: hub and tunnels on) and stays silent only when the row at the host is Served toward the record's fleet for its app and account. No eligibility rule is left in the console. Tests: explicit-tunnel, owner-refused, not-ready and sidecar legacy rows, and another app's or another fleet's forward row, each give C08; a served legacy row (owned and accountless) and the record's own forward row do not. The verdict test pins Served per case and checks Reload sends exactly those hosts through a fleet. Mutations caught: the old local check restored; Served ignoring the Tunnel arm.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 files changed,
+213
−39
internal/console/apiinstances.go+48 −26internal/console/fleetforward_test.go+92 −0internal/edge/edge.go+18 −5internal/edge/fleetforward.go+28 −4internal/edge/fleetverdict_test.go+27 −4
diff --git a/internal/console/apiinstances.go b/internal/console/apiinstances.go| index 53acdedad..4514eb7c5 100644 |
| --- a/internal/console/apiinstances.go |
| +++ b/internal/console/apiinstances.go |
| @@ -40,6 +40,7 @@ import ( |
| "sync/atomic" |
| "time" |
| + "github.com/carlosframework/platform/internal/edge" |
| "github.com/carlosframework/platform/internal/gate" |
| "github.com/carlosframework/platform/internal/hostops" |
| "github.com/carlosframework/platform/internal/metrics" |
| @@ -261,36 +262,47 @@ type instanceListRecord struct { |
| // most hosts: a host with no allow and nothing to say is not reported. |
| Egress *memberEgress `json:"egress,omitempty"` |
| // RouteHeld is FPR-C08 naming the record's fleet when the record is |
| - // placed on a fleet and a row that is not a forward row holds its host |
| - // on the console's box, the hub (forwardHeldReason; fleet public routes |
| - // spec §4.3 step 4, plan ruling P-3). The CLI's REASON cell shows it. |
| + // placed on a fleet and a row at its host on the console's box, the hub, |
| + // is not served toward that fleet for the record's app and account |
| + // (forwardHeldReason; fleet public routes spec §4.3 step 4, plan ruling |
| + // P-3). The CLI's REASON cell shows it. |
| // It is set only on the caller's own record and says nothing of the |
| // row that holds the host. Absent otherwise. |
| RouteHeld string `json:"route_held,omitempty"` |
| } |
| -// forwardHeldReason is FPR-C08 for rec, or "": rec is placed on a fleet and |
| -// rows (the console box's registry, by host) holds a row at its host that is |
| -// not a forward row. The hub's forward phase leaves such a row as it is and |
| -// mints nothing there (spec §4.3 step 4, §4.7), so requests for the host do |
| -// not reach the fleet through a forward row. The console's box is the hub |
| -// (plan ruling P-3), so its own registry is the answer; no box reports it. |
| -// No row, or a forward row, is not held. Nor is a legacy row of the same |
| -// app placed on the record's own fleet whose raw account is the record's or |
| -// empty (controller ruling 2): the edge serves it toward that fleet |
| -// (edge.FleetServeEligible), so requests do reach it. Another account's |
| -// row of an app of the same name is not served toward a fleet the record's |
| -// account owns, and is held. |
| -func forwardHeldReason(rows map[string]registry.Route, rec provision.Record) string { |
| +// hubRouting is the console box's registry as its edge routes it: the rows |
| +// by host, and the fleet arm's Served answer (edge.FleetArmVerdict) over the |
| +// same listing and the same registry's fleets table. The console's box is |
| +// the hub (plan ruling P-3), so the verdict is the one that box's Reload |
| +// makes: hub and tunnels both on. |
| +type hubRouting struct { |
| + rows map[string]registry.Route |
| + served map[string]edge.FleetServed |
| +} |
| + |
| +// forwardHeldReason is FPR-C08 for rec, or "": rec is placed on a fleet, a |
| +// row holds its host on the console's box, the hub, and the edge's own |
| +// decision (hubRouting.served, edge.FleetArmVerdict) does not send that row |
| +// toward rec's fleet for rec's app and account. The hub's forward phase |
| +// leaves a row it did not mint as it is and mints nothing there (spec §4.3 |
| +// step 4, §4.7), so requests for the host do not reach the fleet. No row is |
| +// not held, and neither is a row served toward rec's fleet for its app and |
| +// account: rec's own forward row, or a legacy row of the app on that fleet |
| +// that the edge admits (accountless, or the fleet owner's). Anything else |
| +// is held: a row the edge sends down its own Tunnel, refuses, does not |
| +// serve (not ready, a sidecar, not on a fleet), or serves toward another |
| +// fleet, app or account. This function decides nothing about eligibility. |
| +// held nil (the registry could not be read) says nothing. |
| +func forwardHeldReason(held *hubRouting, rec provision.Record) string { |
| fleet, placed := registry.FleetPlacement(rec.Region) |
| - if !placed { |
| + if !placed || held == nil { |
| return "" |
| } |
| - rt, ok := rows[rec.Host] |
| - if !ok || rt.IsForward() { |
| + if _, ok := held.rows[rec.Host]; !ok { |
| return "" |
| } |
| - if rt.App == rec.App && rt.Region == rec.Region && (rt.Account == "" || rt.Account == rec.Account) { |
| + if held.served[rec.Host] == (edge.FleetServed{Fleet: fleet, App: rec.App, Account: rec.Account}) { |
| return "" |
| } |
| return fmt.Sprintf("another route on the router holds this name, so requests do not reach fleet %s. the deployment's operator can remove that route", fleet) |
| @@ -374,9 +386,10 @@ func memberEgressView(h status.HostEgress, ok bool) *memberEgress { |
| // forward row here takes its word as a record with no row here does, from |
| // the boxes that report it and then fleetHealth. |
| // |
| -// rows is the registry listing by host, for the held-host reason |
| -// (forwardHeldReason); nil when it could not be read. |
| -func (s *Server) instanceHealth(ctx context.Context, recs []provision.Record) (health map[string]string, rows map[string]registry.Route) { |
| +// held is the registry listing by host and the fleet arm's answer over it, |
| +// for the held-host reason (forwardHeldReason); nil when the routes or the |
| +// fleets table could not be read. |
| +func (s *Server) instanceHealth(ctx context.Context, recs []provision.Record) (health map[string]string, held *hubRouting) { |
| out := make(map[string]string, len(recs)) |
| for _, rec := range recs { |
| out[rec.Host] = "Setting up" |
| @@ -401,6 +414,15 @@ func (s *Server) instanceHealth(ctx context.Context, recs []provision.Record) (h |
| for _, rt := range routes { |
| byHost[rt.Host] = rt |
| } |
| + if fleets, err := reg.ListFleets(); err != nil { |
| + log.Printf("console: api instances health: registry fleets: %v", err) |
| + } else { |
| + owners := make(map[string]string, len(fleets)) |
| + for _, f := range fleets { |
| + owners[f.Name] = f.Account |
| + } |
| + held = &hubRouting{rows: byHost, served: edge.FleetArmVerdict(routes, owners, true, true).Served} |
| + } |
| // routeFor is the join reduced to the routes that ANSWER for these |
| // records, built once and used by both loops so the two can never drift. |
| routeFor := make(map[string]registry.Route, len(recs)) |
| @@ -519,7 +541,7 @@ func (s *Server) instanceHealth(ctx context.Context, recs []provision.Record) (h |
| for h, word := range s.healthByHost(ctx, routeFor, sinceByHost) { |
| out[h] = word |
| } |
| - return out, byHost |
| + return out, held |
| } |
| // fleetHealth fills in, from join, the health of each record placed on a |
| @@ -1282,7 +1304,7 @@ func (s *Server) handleAPIInstanceList(w http.ResponseWriter, r *http.Request) { |
| limit = n |
| } |
| } |
| - health, rows := s.instanceHealth(ctx, recs) |
| + health, held := s.instanceHealth(ctx, recs) |
| fleetHealth(health, recs, join, acct.Sqid, app) |
| counts := map[string]int{} |
| matched := make([]instanceListRecord, 0, len(recs)) |
| @@ -1311,7 +1333,7 @@ func (s *Server) handleAPIInstanceList(w http.ResponseWriter, r *http.Request) { |
| RegionName: regionlabel.ForRecord(rec, home, names).Text, |
| MovePhrase: regionlabel.MovePhrase(rec, home, names), |
| Egress: join.egressFor(rec.Host, acct.Sqid, app), |
| - RouteHeld: forwardHeldReason(rows, rec)}) |
| + RouteHeld: forwardHeldReason(held, rec)}) |
| } |
| total := len(matched) |
| // provision.ListRecords returns records host-sorted and nothing above |
diff --git a/internal/console/fleetforward_test.go b/internal/console/fleetforward_test.go| index 53a694b78..857fc13ca 100644 |
| --- a/internal/console/fleetforward_test.go |
| +++ b/internal/console/fleetforward_test.go |
| @@ -199,6 +199,9 @@ func TestInstanceListNamesTheHeldHost(t *testing.T) { |
| elsewhere := fprRecord(t, fx, "elsewhere", home, created) |
| namesake := fprRecord(t, fx, "namesake", home, created) |
| reg := openTestReg(t, fx) |
| + // The console's box is the hub (plan ruling P-3): its fleets table says |
| + // who owns each fleet, as the edge's does. |
| + fprFleets(t, reg, map[string]string{"home": fx.sqid, "away": fx.sqid}) |
| for _, rt := range []registry.Route{ |
| // A hand row of the app's own (carlos add), never placed. |
| {Host: hand.Host, Slug: "hand", Kind: "instance", App: "shop", Account: fx.sqid, Channel: "r10-proxy", Status: "ready"}, |
| @@ -242,6 +245,95 @@ func TestInstanceListNamesTheHeldHost(t *testing.T) { |
| } |
| } |
| +// fprFleets writes the hub's fleets table: each fleet's owning account. |
| +func fprFleets(t *testing.T, reg *registry.Registry, owners map[string]string) { |
| + t.Helper() |
| + for name, account := range owners { |
| + if err := reg.UpsertFleet(registry.Fleet{Name: name, Account: account, Bucket: name + "-data"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| +} |
| + |
| +// Whole-branch review round 1, finding 2: C08 is silent only when the edge's |
| +// own decision (edge.FleetArmVerdict's Served) sends the row at the host |
| +// toward the record's fleet, for the record's app and account. Every other |
| +// row holds the name: a legacy row the edge sends down its explicit Tunnel, |
| +// one it refuses because the fleet's owner is another account, one that is |
| +// not ready, a sidecar, and a forward row of another app or another fleet |
| +// left at the host in a collision. A served legacy row of the app on the |
| +// record's fleet, accountless or the owner's, and the record's own forward |
| +// row, are not held. |
| +func TestHeldHostFollowsTheFleetArm(t *testing.T) { |
| + fx := newConsoleFixture(t) |
| + if _, err := fx.st.CreateAppIn(OpsAccountID, "shop", "paul@keymail.dev", time.Now()); err != nil { |
| + t.Fatal(err) |
| + } |
| + created := time.Now().UTC().Add(-10 * time.Second) |
| + home, away, lent := registry.PlacementTarget("home"), registry.PlacementTarget("away"), registry.PlacementTarget("lent") |
| + recs := map[string]provision.Record{} |
| + for slug, region := range map[string]string{ |
| + "tunnel": home, "refused": lent, "failed": home, "sidecar": home, |
| + "otherapp": home, "otherfleet": home, |
| + "served": home, "accountless": home, "own": home, |
| + } { |
| + recs[slug] = fprRecord(t, fx, slug, region, created) |
| + } |
| + reg := openTestReg(t, fx) |
| + // lent is owned by another valid account: the record was placed on it, |
| + // and the hub's table no longer gives it to the record's account. |
| + fprFleets(t, reg, map[string]string{"home": fx.sqid, "away": fx.sqid, "lent": "baj"}) |
| + legacy := func(slug string, edit func(*registry.Route)) registry.Route { |
| + rec := recs[slug] |
| + rt := registry.Route{Host: rec.Host, Slug: slug, Kind: "instance", App: "shop", Account: fx.sqid, |
| + Region: rec.Region, Channel: "stable", Status: "ready"} |
| + if edit != nil { |
| + edit(&rt) |
| + } |
| + return rt |
| + } |
| + for _, rt := range []registry.Route{ |
| + legacy("tunnel", func(r *registry.Route) { r.Tunnel = "t1" }), |
| + legacy("refused", nil), |
| + legacy("failed", func(r *registry.Route) { r.Status = "failed" }), |
| + legacy("sidecar", func(r *registry.Route) { r.Kind = "sidecar" }), |
| + legacy("served", nil), |
| + legacy("accountless", func(r *registry.Route) { r.Account = "" }), |
| + } { |
| + if err := reg.Upsert(rt); err != nil { |
| + t.Fatalf("%s: %v", rt.Host, err) |
| + } |
| + } |
| + otherApp := recs["otherapp"] |
| + otherApp.App = "blog" |
| + fprForward(t, reg, otherApp) |
| + otherFleet := recs["otherfleet"] |
| + otherFleet.Region = away |
| + fprForward(t, reg, otherFleet) |
| + fprForward(t, reg, recs["own"]) |
| + reg.Close() |
| + token := cliToken(t, fx, "paul@keymail.dev", "code-fpr-arm") |
| + |
| + rows, body := fprListed(t, fx, token) |
| + for slug, fleet := range map[string]string{ |
| + "tunnel": "home", "refused": "lent", "failed": "home", "sidecar": "home", |
| + "otherapp": "home", "otherfleet": "home", |
| + "served": "", "accountless": "", "own": "", |
| + } { |
| + row, ok := rows[fprHost(slug)] |
| + if !ok { |
| + t.Fatalf("%s not listed: %s", slug, body) |
| + } |
| + want := "" |
| + if fleet != "" { |
| + want = fmt.Sprintf(fprHeldWords, fleet) |
| + } |
| + if got := fprString(t, row, "route_held"); got != want { |
| + t.Errorf("%s route_held = %q, want %q", slug, got, want) |
| + } |
| + } |
| +} |
| + |
| // Controller ruling 1 (Task 11 review): an unplace leaves no fleet behind. |
| // The placement column is "" both for an app never placed and for one |
| // unplaced, and appPlacement and the startup backfill read the app's rows |
diff --git a/internal/edge/edge.go b/internal/edge/edge.go| index 8628fcec4..8f9b16d37 100644 |
| --- a/internal/edge/edge.go |
| +++ b/internal/edge/edge.go |
| @@ -829,7 +829,12 @@ func (e *Edge) Reload() error { |
| // genManaged: an activator-managed instance reached through its |
| // current generation (appSocketProxy), generations on only. |
| genManaged := false |
| - fleet, isFleetPlaced := registry.FleetPlacement(t.Region) |
| + // served is the fleet arm's positive answer for this row |
| + // (FleetArmVerdict's Served): both fleet cases below take their fleet |
| + // from it, and nothing else reaches a fleet's tunnel, so a host is |
| + // served through a fleet exactly when the verdict says so. The |
| + // console's held-host reason (FPR-C08) reads the same answer. |
| + served, viaFleet := verdict.Served[t.Host] |
| switch { |
| // A forward row (fleet public routes spec §4.2) is the hub's row for |
| // an app placed on a fleet: it runs nothing here, and the only way it |
| @@ -840,9 +845,13 @@ func (e *Edge) Reload() error { |
| // no map entry (so Allowed is false and no certificate is ordered for |
| // it) and never falls through. Eligibility is FleetServeEligible, the |
| // one rule: the hub only, inert, on a fleet in this box's fleets |
| - // table, its raw account the fleet's owner. |
| + // table, its raw account the fleet's owner. An admitted forward row |
| + // is always Served; one that is not is never served by another arm. |
| case t.IsForward(): |
| - p := fleetProxy(fleet, t.FleetBox, e.tunnels) |
| + if !viaFleet { |
| + continue |
| + } |
| + p := fleetProxy(served.Fleet, t.FleetBox, e.tunnels) |
| p.ModifyResponse = e.responseModifier(t) |
| proxy = p |
| viaTunnel = true |
| @@ -904,11 +913,15 @@ func (e *Edge) Reload() error { |
| // entry, rather than degraded to its socket, because the hub is where |
| // its traffic would go. An accountless row is the pre-account |
| // compatibility case: served, and logged. |
| - case isFleetPlaced && e.tunnels != nil: |
| + // |
| + // Served holds exactly the fleet-placed rows with no Tunnel, ready and |
| + // not refused, on an edge whose tunnels are on: the rows this case |
| + // has always taken. |
| + case viaFleet: |
| if why, noted := verdict.Noted[t.Host]; noted { |
| e.logThrottled("fleet-accountless "+t.Host, fmt.Sprintf("route %s: %s", t.Host, why)) |
| } |
| - p := fleetProxy(fleet, t.FleetBox, e.tunnels) |
| + p := fleetProxy(served.Fleet, t.FleetBox, e.tunnels) |
| p.ModifyResponse = e.responseModifier(t) |
| proxy = p |
| viaTunnel = true |
diff --git a/internal/edge/fleetforward.go b/internal/edge/fleetforward.go| index 8b3e2b003..be6bbfe70 100644 |
| --- a/internal/edge/fleetforward.go |
| +++ b/internal/edge/fleetforward.go |
| @@ -107,8 +107,22 @@ type FleetVerdict struct { |
| // Noted maps a served fleet-placed host to a log fragment: the |
| // accountless compatibility case. |
| Noted map[string]string |
| + // Served maps every host the fleet arm serves to where it sends it |
| + // (FleetServed). Reload's two fleet cases take the fleet from it and |
| + // serve nothing else through a fleet, so a host is here exactly when |
| + // Reload sends it through a fleet's tunnel; the console's held-host |
| + // reason (FPR-C08) reads it for the same answer. |
| + Served map[string]FleetServed |
| } |
| +// FleetServed is where the fleet arm sends a served row: its fleet, the |
| +// row's app, and the account it is served for, the fleet's owner in the |
| +// owners map (FleetServeEligible has matched the row's own account to it, |
| +// and an accountless row, the compatibility case, is served on the owner's |
| +// fleet; "" when the fleet is not in the map, which only an accountless row |
| +// reaches). |
| +type FleetServed struct{ Fleet, App, Account string } |
| + |
| // FleetArmVerdict decides, over one registry listing, which hosts the fleet |
| // arm refuses (fleet public routes spec §4.4). It is the one place the |
| // decision is made: Reload serves by it, the edges-file writer publishes by |
| @@ -130,8 +144,13 @@ type FleetVerdict struct { |
| // then over the listing: a platform alias whose source is refused is |
| // refused with it (it is served with its source's own entry, |
| // PlatformAliasFold), so whatever is attached to or claimed on it goes too. |
| +// |
| +// A row judged and not refused is Served when Reload's switch sends it |
| +// through the fleet arm: a forward row (its case comes first), or a |
| +// fleet-placed row with no Tunnel (a Tunnel takes the tunnel arm ahead of |
| +// the fleet arm). A host the alias step refuses is not Served. |
| func FleetArmVerdict(routes []registry.Route, owners map[string]string, hub, tunnels bool) FleetVerdict { |
| - v := FleetVerdict{Refused: map[string]string{}, Noted: map[string]string{}} |
| + v := FleetVerdict{Refused: map[string]string{}, Noted: map[string]string{}, Served: map[string]FleetServed{}} |
| for _, rt := range routes { |
| if rt.IsSidecar() { |
| continue |
| @@ -146,12 +165,16 @@ func FleetArmVerdict(routes []registry.Route, owners map[string]string, hub, tun |
| continue |
| } |
| ok, why := FleetServeEligible(rt, hub, owners) |
| - switch { |
| - case !ok: |
| + if !ok { |
| v.Refused[rt.Host] = why |
| - case why != "": |
| + continue |
| + } |
| + if why != "" { |
| v.Noted[rt.Host] = why |
| } |
| + if fleet, placed := registry.FleetPlacement(rt.Region); placed && (rt.IsForward() || rt.Tunnel == "") { |
| + v.Served[rt.Host] = FleetServed{Fleet: fleet, App: rt.App, Account: owners[fleet]} |
| + } |
| } |
| sources, _ := PlatformAliasFold(routes) |
| for host, src := range sources { |
| @@ -159,6 +182,7 @@ func FleetArmVerdict(routes []registry.Route, owners map[string]string, hub, tun |
| if _, own := v.Refused[host]; !own { |
| v.Refused[host] = fmt.Sprintf("platform alias of %s, which is refused", src) |
| } |
| + delete(v.Served, host) |
| } |
| } |
| return v |
diff --git a/internal/edge/fleetverdict_test.go b/internal/edge/fleetverdict_test.go| index c90245390..d1ea3671c 100644 |
| --- a/internal/edge/fleetverdict_test.go |
| +++ b/internal/edge/fleetverdict_test.go |
| @@ -21,6 +21,13 @@ import ( |
| // holds out through every fold, is not. So Allowed(host) == !refused[host] |
| // for every fixture host, and a host that is merely unserved cannot pass for |
| // a refused one or the other way round. |
| +// |
| +// Served (whole-branch review round 1, finding 2) is pinned the same way: |
| +// for each case the hosts the fleet arm serves, each toward fleet home for |
| +// app shop of home's owner, and Reload sends exactly those hosts through a |
| +// fleet (their own entry, over a reverse channel, with no Tunnel of their |
| +// own). An accountless hand row is served for the owner; a Tunnel row takes |
| +// its own arm and is not Served. |
| func TestFleetArmVerdictIsWhatReloadRefuses(t *testing.T) { |
| const anchor = "anchor.example.com" |
| hand := func(host, account string) registry.Route { |
| @@ -59,16 +66,18 @@ func TestFleetArmVerdictIsWhatReloadRefuses(t *testing.T) { |
| "side.baj.example.com", "tunnel.baj.example.com"} |
| cases := []struct { |
| name, tunnelHost, fleet string |
| - refused []string |
| + refused, served []string |
| }{ |
| // The not-ready hand row of a non-owner is not judged (readiness |
| // first), the not-ready forward row is refused, and the platform |
| // alias inherits its refused source. |
| {"hub", "tunnel.example.com", "", []string{"shop.baj.example.com", "idle.bah.example.com", |
| - "hand.baj.example.com", "apex.baj.example.com"}}, |
| + "hand.baj.example.com", "apex.baj.example.com"}, |
| + []string{"shop.bah.example.com", "hand.bah.example.com", "hand.none.example.com"}}, |
| {"tunnels on, not the hub", "tunnel.example.com", "home", []string{"shop.bah.example.com", "shop.baj.example.com", |
| - "idle.bah.example.com", "hand.baj.example.com", "apex.baj.example.com"}}, |
| - {"no tunnels", "", "", []string{"shop.bah.example.com", "shop.baj.example.com", "idle.bah.example.com"}}, |
| + "idle.bah.example.com", "hand.baj.example.com", "apex.baj.example.com"}, |
| + []string{"hand.bah.example.com", "hand.none.example.com"}}, |
| + {"no tunnels", "", "", []string{"shop.bah.example.com", "shop.baj.example.com", "idle.bah.example.com"}, nil}, |
| } |
| for _, c := range cases { |
| t.Run(c.name, func(t *testing.T) { |
| @@ -128,6 +137,14 @@ func TestFleetArmVerdictIsWhatReloadRefuses(t *testing.T) { |
| t.Errorf("%s refused with no reason", h) |
| } |
| } |
| + if got, want := slices.Sorted(maps.Keys(v.Served)), slices.Sorted(slices.Values(c.served)); !slices.Equal(got, want) { |
| + t.Fatalf("served = %v, want %v", got, want) |
| + } |
| + for h, at := range v.Served { |
| + if want := (FleetServed{Fleet: "home", App: "shop", Account: fwdOwner}); at != want { |
| + t.Errorf("%s served toward %+v, want %+v", h, at, want) |
| + } |
| + } |
| e, err := New(reg, nil) |
| if err != nil { |
| @@ -148,6 +165,12 @@ func TestFleetArmVerdictIsWhatReloadRefuses(t *testing.T) { |
| if served := e.Allowed(h); served == refused { |
| t.Errorf("%s: Reload serves %v, the verdict refuses %v", h, served, refused) |
| } |
| + _, wantFleet := v.Served[h] |
| + up, ok := e.lookupUpstream(h) |
| + viaFleet := ok && !up.alias && up.route.Host == h && up.viaTunnel && up.route.Tunnel == "" |
| + if viaFleet != wantFleet { |
| + t.Errorf("%s: Reload sends it through a fleet %v, the verdict serves it %v", h, viaFleet, wantFleet) |
| + } |
| } |
| }) |
| } |