composer: a module that fetches from an artifact store no node reaches waits alone, never the node
Typed resolution.NoStoreError from artifactsInto (image, source, tools bundle, runtime program, templates archive), laid on its module by composeWithoutStoreFetchers with A-452's "nothing provides" words and composed again, instead of a whole-node refusal. Replaces storeHeld and modulesNeedingTheStore, whose shape list missed bundles and held stand-ins. Builds: design 47 G-22 A-452, A-461, A-461b, A-459b
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
||||
"git.novox.be/novox/mesh-networking/modules/mesh-wireguard/go/overlay"
|
||||
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
||||
"github.com/novox/mesh-host/internal/compose/resolution"
|
||||
"github.com/novox/mesh-host/internal/registryforms"
|
||||
)
|
||||
|
||||
// The contracts of the node-engine's statement that gate what a machine is sent, as the controller's link package names them
|
||||
@@ -42,8 +41,6 @@ type Placed struct {
|
||||
// manifest's own number as the Reading mode composes them, and never invented. The controller's adapter allocates and
|
||||
// composes again.
|
||||
ForeseenPorts []string
|
||||
// storeHeld are the modules left out of the declaration because the artifact store has no known address, and why (A-461).
|
||||
storeHeld map[string]string
|
||||
}
|
||||
|
||||
// Places composes the place half of the rendering for a node (the controller's renderingFor in the Reading and Foreseeing modes,
|
||||
@@ -101,7 +98,6 @@ func (c *composer) places(nodeName string, resolved Resolved) (Placed, error) {
|
||||
var noAddress *storeListenError
|
||||
if errors.As(err, &noAddress) {
|
||||
// Only the store holder's listen refusal holds its fetchers; any other error still refuses the node (A-461b).
|
||||
out.storeHeld = modulesNeedingTheStore(plan.Modules, err)
|
||||
store, err = "", nil
|
||||
}
|
||||
if err != nil {
|
||||
@@ -338,29 +334,6 @@ func (c *composer) namesInTheMesh() map[string]string {
|
||||
return out
|
||||
}
|
||||
|
||||
// modulesNeedingTheStore are the modules with a resource whose image or source is a kept reference into the artifact store, each
|
||||
// with why it waits: nothing provides the store's address (A-461).
|
||||
func modulesNeedingTheStore(modules []catalogue.Manifest, why error) map[string]string {
|
||||
out := map[string]string{}
|
||||
for _, m := range modules {
|
||||
for _, res := range m.Resources {
|
||||
needs := false
|
||||
for _, key := range []string{"image", "source"} {
|
||||
if written, ok := res[key].(string); ok {
|
||||
if _, kept := registryforms.Forms.InArtifactStore(written); kept {
|
||||
needs = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if needs {
|
||||
out[m.Module] = fmt.Sprintf("nothing provides %q, wanted by %s: %v", "the artifact store's address", m.Module, why)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// StoreSeat is the seat whose holder is the artifact store (novox/hq ADR 0632 §1): the store's address is that holder's
|
||||
// listen open to the mesh, on the machine assignment puts it on. The provision artifact-store it was found by before is
|
||||
// retired; no module serves it.
|
||||
|
||||
Reference in New Issue
Block a user