No client names the holder of the seat mesh-provisioner: each reader keeps its own constant, held to its manifest (ADR 0625 section 4, issue 1966)
Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
@@ -9,9 +9,9 @@ import (
|
||||
"path/filepath"
|
||||
"sync/atomic"
|
||||
|
||||
provisions "git.novox.be/novox/mesh-contracts/provisioning/go/clients/meshprovisionerclient"
|
||||
"git.novox.be/novox/mesh-sdk/go/declaration"
|
||||
"github.com/novox/mesh-host/internal/apply"
|
||||
"github.com/novox/mesh-host/internal/buckets"
|
||||
"github.com/novox/mesh-host/internal/filling"
|
||||
"github.com/novox/mesh-host/internal/link"
|
||||
"github.com/novox/mesh-host/internal/store"
|
||||
@@ -130,7 +130,7 @@ func provisionSecretsOn(queue *link.Session, node, statePath string) provisionSe
|
||||
p.list = func(ctx context.Context, prefix string) (map[string][]byte, error) {
|
||||
wctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
updates, err := queue.KVWatch(wctx, provisions.ProvisionsBucket, prefix+">")
|
||||
updates, err := queue.KVWatch(wctx, buckets.Provisions, prefix+">")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -141,7 +141,7 @@ func provisionSecretsOn(queue *link.Session, node, statePath string) provisionSe
|
||||
return nil, ctx.Err()
|
||||
case u, ok := <-updates:
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("the watch of %s ended before it caught up", provisions.ProvisionsBucket)
|
||||
return nil, fmt.Errorf("the watch of %s ended before it caught up", buckets.Provisions)
|
||||
}
|
||||
switch {
|
||||
case u.Caught:
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
provisions "git.novox.be/novox/mesh-contracts/provisioning/go/clients/meshprovisionerclient"
|
||||
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
||||
"github.com/novox/mesh-host/internal/buckets"
|
||||
)
|
||||
|
||||
// provisionSecrets fills a provision's value into a file the provisioner's client hands the node-engine to write
|
||||
@@ -92,7 +93,7 @@ func byName(keys map[string][]byte, name string) (provisions.Provision, string,
|
||||
}
|
||||
switch len(hit) {
|
||||
case 0:
|
||||
return provisions.Provision{}, "", fmt.Errorf("no provision of %s goes by that name: nothing asks for it", provisions.ProvisionsRead)
|
||||
return provisions.Provision{}, "", fmt.Errorf("no provision of %s goes by that name: nothing asks for it", buckets.ProvisionsRead)
|
||||
case 1:
|
||||
return got, hit[0], nil
|
||||
}
|
||||
|
||||
@@ -41,6 +41,15 @@ const (
|
||||
AssignerHolder = "mesh-delivery-assigner"
|
||||
)
|
||||
|
||||
// The state of the provisioner seat's holder that the engine reads, named by the holder's module (ADR 0634 §1, finding F4).
|
||||
const (
|
||||
// ProvisionerHolder is the module holding the seat mesh-provisioner; Provisions its state provisions, which the engine
|
||||
// watches for the key of a provision it fills (`<node>.>`), ProvisionsRead the name a manifest's reads gives it.
|
||||
ProvisionerHolder = "mesh-provisioner"
|
||||
Provisions = ProvisionerHolder + "_provisions"
|
||||
ProvisionsRead = ProvisionerHolder + ".provisions"
|
||||
)
|
||||
|
||||
// The states of the catalogue seat's holder that the engine reads, named by the holder's module (ADR 0634 §1, finding F4).
|
||||
const (
|
||||
// Modules holds a module's source, `<module>`; Manifests a manifest by its digest; Verdicts the judge's verdict of a
|
||||
|
||||
@@ -62,7 +62,8 @@ func TestTheHoldersBucketsAreTheirStatesBuckets(t *testing.T) {
|
||||
"Placement": {Placement, "mesh-delivery-assigner_placement"}, "PlacementCandidates": {PlacementCandidates, "mesh-delivery-assigner_candidates"},
|
||||
"Wants": {Wants, "mesh-delivery-assigner_wants"}, "Modules": {Modules, "mesh-delivery-indexer_modules"},
|
||||
"Manifests": {Manifests, "mesh-delivery-indexer_manifests"}, "Verdicts": {Verdicts, "mesh-delivery-indexer_verdicts"},
|
||||
"Candidates": {Candidates, "mesh-delivery-indexer_candidates"},
|
||||
"Candidates": {Candidates, "mesh-delivery-indexer_candidates"}, "Provisions": {Provisions, "mesh-provisioner_provisions"},
|
||||
"ProvisionsRead": {ProvisionsRead, "mesh-provisioner.provisions"},
|
||||
} {
|
||||
if c[0] != c[1] {
|
||||
t.Errorf("%s = %q, want %q", name, c[0], c[1])
|
||||
|
||||
Reference in New Issue
Block a user