R6: the controller writes signed per-node compositions and their digests; plans, pushes and their verbs go (issue 1945) #457

Merged
mesh-tools merged 67 commits from feat/r6 into main 2026-10-24 23:00:31 +00:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit e338b1f0f4 - Show all commits
@@ -34,8 +34,8 @@ func TestAConvergedDeclarationIsByteForByteWhatItWas(t *testing.T) {
t.Fatal(err)
}
if string(body) != convergedBefore {
t.Fatalf("a converged declaration changed; an older host parses this strictly:\n%s\n%s",
body, convergedBefore)
// One line, got first: the verdict keeps only a failure's first line (issue 1921), and the bytes are what to capture.
t.Fatalf("a converged declaration changed; an older host parses this strictly: got %s want %s", body, convergedBefore)
}
if bytes.Contains(body, []byte(`"adoption"`)) {
t.Fatal("a converged declaration names adoption; an older host would refuse it")
+5 -1
View File
@@ -47,7 +47,11 @@ func composed(t *testing.T, open *stores, node string) sendable {
// machine's own resolver knows the mesh's names now — and left this string carrying it, so the
// guard failed for a day and nothing ran it. A field an older host never sees is the one change
// this guard permits; a field it would refuse is the one it exists to catch.
const convergedBefore = `{"declaration":1,"resources":[{"content":"hello","id":"hello-web.page","path":"/var/lib/hello-web/index.html","type":"file"},{"id":"hello-web.server","image":"registry.example/hello@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","name":"hello-web","type":"container"},{"id":"hello-web.served","path":"/var/lib/hello-web","type":"directory"}]}`
//
// Re-captured for release 6 (issue 1945): every composition is for a node-engine of release 6, which reads a module per
// resource (readNode sets ReadsModules), so each resource carries its "module". An older host that never said it reads them is
// no longer sent a declaration; the field is the wire's own since issue 1145.
const convergedBefore = `{"declaration":1,"resources":[{"content":"hello","id":"hello-web.page","module":"hello-web","path":"/var/lib/hello-web/index.html","type":"file"},{"id":"hello-web.server","image":"registry.example/hello@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","module":"hello-web","name":"hello-web","type":"container"},{"id":"hello-web.served","module":"hello-web","path":"/var/lib/hello-web","type":"directory"}]}`
func mustNodes(t *testing.T, open *stores) []inventory.Node {
t.Helper()