Find the delivery's owner on the controller's own path by the seat's claim, not its name (issue 1210)
This commit is contained in:
@@ -39,7 +39,7 @@ func TestEachModuleHasItsGateRule(t *testing.T) {
|
||||
}{
|
||||
{"mesh-controller", nil, 1, 0, true, "the controller's rule"},
|
||||
{"node-tools", nil, 1, 0, true, "the tool runner's rule"},
|
||||
{catalogue.DeliverySeat, nil, 1, 0, false, "mesh-delivery's rule"},
|
||||
{catalogue.DeliverySeat, []catalogue.Claim{{Name: catalogue.DeliverySeat}}, 1, 0, false, "mesh-delivery's rule"},
|
||||
{"mesh-host", nil, 3, 2 * time.Minute, false, "the core's rule"},
|
||||
{"dnsmasq", []catalogue.Claim{{Name: resolverSeat}}, 3, 2 * time.Minute, false, "the core's rule"},
|
||||
{"nats", nil, 3, 2 * time.Minute, false, "the core's rule"},
|
||||
@@ -56,7 +56,12 @@ func TestEachModuleHasItsGateRule(t *testing.T) {
|
||||
// Every module that was core stays core for its delivery budget and its walk: only its readings change.
|
||||
func TestTheCoreStaysTheCore(t *testing.T) {
|
||||
for _, m := range []string{"mesh-controller", "mesh-host", "node-tools", "nats", catalogue.DeliverySeat} {
|
||||
if !coreModule(m, catalogue.Manifest{Module: m}) {
|
||||
// The delivery's owner is core by the claim of the seat, not by its name (novox/hq ADR 0437 §3, issue 1210).
|
||||
claims := []catalogue.Claim(nil)
|
||||
if m == catalogue.DeliverySeat {
|
||||
claims = []catalogue.Claim{{Name: catalogue.DeliverySeat}}
|
||||
}
|
||||
if !coreModule(m, catalogue.Manifest{Module: m, Claims: claims}) {
|
||||
t.Errorf("%s is no longer judged as the core for its class", m)
|
||||
}
|
||||
}
|
||||
@@ -78,7 +83,11 @@ func aGateOn(module, node string, since time.Time) *gateOn {
|
||||
}
|
||||
|
||||
func (o *gateOn) read(at time.Time, h health, why string) {
|
||||
r := gateRuleOf(o.module, catalogue.Manifest{Module: o.module})
|
||||
m := catalogue.Manifest{Module: o.module}
|
||||
if o.module == catalogue.DeliverySeat { // today's module, which claims the seat
|
||||
m.Claims = []catalogue.Claim{{Name: catalogue.DeliverySeat}}
|
||||
}
|
||||
r := gateRuleOf(o.module, m)
|
||||
floor := gateFloor(o.module, r, *o.g.Since, []string{o.node}, o.g.Applied, o.holder)
|
||||
tallyGate(o.g, gateJudging{modules: []string{o.module}, reading: map[string]health{o.module: h},
|
||||
worst: h, why: why, rules: map[string]gateRule{o.module: r}, floors: map[string]time.Time{o.module: floor}}, at)
|
||||
|
||||
Reference in New Issue
Block a user