Carry each contribution, composed, and the consumer's address in its plan entry, and let a process read another module's state, so route-proxy serves routes from the seat's plans alone (issue 774, research 072 row 34)
This commit is contained in:
@@ -1076,6 +1076,11 @@ func (r Resolution) compose(with Rendering, owner map[string]string,
|
||||
return nil, err
|
||||
}
|
||||
handed.name(m.Module, to, own)
|
||||
given, err := r.givenOf(m, to, with.Settings[m.Module])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
handed.give(m.Module, to, r.At, given)
|
||||
}
|
||||
}
|
||||
// A handed collector is filled from items alone: each old form its collections would have held is said
|
||||
@@ -1823,6 +1828,32 @@ func (r Resolution) contributions(settings SettingsBy, grants []Grant,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// givenOf is each contribution m makes to one requirement, composed as its provider receives it in a received file
|
||||
// (contributions): the one of `contributes` with what the module shares of its bucket, then each of
|
||||
// `contributes-many` by local name. The plan carries them (PlanProvision.Given, issue 774), so the two forms cannot
|
||||
// say different things.
|
||||
func (r Resolution) givenOf(m Manifest, to string, layers []Layer) ([]PlanGiven, error) {
|
||||
var out []PlanGiven
|
||||
if raw, ok := m.Contributes[to]; ok {
|
||||
values, err := r.composed(m, to, raw, layers, m.Module+" contributing to "+to)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if values, err = withShares(m, to, values); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, PlanGiven{Values: values})
|
||||
}
|
||||
for _, local := range sortedKeys(m.ContributesMany[to]) {
|
||||
values, err := r.composed(m, to, m.ContributesMany[to][local], layers, m.Module+" contributing "+local+" to "+to)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, PlanGiven{Local: local, Values: values})
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// composed is one contribution as its provider receives it: settled with this node's settings, its
|
||||
// endpoint's port filled in, and its names composed from the label.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user