Answer a module's own secrets to its node-engine when its plan only keys a provision, so twenty modules whose route the provisioner now keys compose again (issue 774)
mesh/delivery merged: source.main moved to novox/mesh-catalog@ca48943b925a
mesh/check being carried to d5c4f8aaa968 on ca48943b925a | from 5be46a80cb35
mesh/delivery merged: source.main moved to novox/mesh-catalog@ca48943b925a
mesh/check being carried to d5c4f8aaa968 on ca48943b925a | from 5be46a80cb35
This commit is contained in:
@@ -236,3 +236,38 @@ func TestTheWatchedAssignmentsAnswerWithoutTheBusOnceCaughtUp(t *testing.T) {
|
||||
t.Errorf("caught up, the mirror asked the bus %d times", asked)
|
||||
}
|
||||
}
|
||||
|
||||
// Issue 774, 2026-10-30 23:33: the seat mesh-provisioner keys a provision its provider's helper answers for a module that
|
||||
// is not handed (catalogue.Keyed), so such a module has a plan naming provisions alone (grafana's route). That plan hands
|
||||
// none of its files or secrets: `own` still answers the module's own secrets, or the node-engine composing it finds none
|
||||
// made (fifteen modules on ace and five on novox failed so). A plan that names a template, a file, a secret or an item
|
||||
// hands the module, and its secrets are left to the client.
|
||||
func TestOwnLeavesOutOnlyAModuleWhosePlanHandsIt(t *testing.T) {
|
||||
plans := assignments{
|
||||
"anchor.grafana": `{"node":"anchor","module":"grafana","provisioning":{"templates":{"digest":"","source":""},` +
|
||||
`"files":null,"provisions":[{"provision":"route","provider":"anchor","provider-module":"route-proxy"}]}}`,
|
||||
"anchor.web": `{"node":"anchor","module":"web","provisioning":{"templates":{"digest":"sha256:1","source":"web.tar"},` +
|
||||
`"files":[{"path":"/etc/web.conf"}],"secrets":[{"name":"password"}]}}`,
|
||||
"anchor.db": `{"node":"anchor","module":"db","provisioning":{"templates":{"digest":"","source":""},"files":null,` +
|
||||
`"secrets":[{"name":"root"}]}}`,
|
||||
}
|
||||
v := newVault(t, nil)
|
||||
v.Askers = Declared{Read: plans.read, Store: v.Store}
|
||||
pub, _ := aSealingKey(t)
|
||||
for _, m := range []MoveOf{
|
||||
{Node: "anchor", Module: "grafana", Name: "admin", Origin: "made", Generation: "g-1", SealingKey: pub},
|
||||
{Node: "anchor", Module: "web", Name: "password", Origin: "made", Generation: "g-1", SealingKey: pub},
|
||||
{Node: "anchor", Module: "db", Name: "root", Origin: "made", Generation: "g-1", SealingKey: pub},
|
||||
} {
|
||||
if _, err := moveIn(t, v, "node.anchor", m, "v-"+m.Module); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
got, err := v.OwnOfNode("node.anchor")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(got.Own) != 1 || got.Own[0].Module != "grafana" || got.Own[0].Name != "admin" {
|
||||
t.Errorf("anchor was answered %+v; want grafana's admin alone (its plan keys a route and hands nothing)", got.Own)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user