Files
mesh-controller/internal/catalogue/parseall_test.go
T
jschoubben 53eb000a84 A container may not mount a path the module never declared
Closes the half of 04-ISSUES/026 that would otherwise come back. The
fourteen mounts across the forge, the mail system, the store and the
object store are all declared now — but nothing said they had to be, so
they were right by coincidence and the next volume added would not be.

A bind mount whose source does not exist is created by the container
runtime, as root, with a mode it picks. So `owner` and `mode` — which
exist precisely so a module can say who its data belongs to — were
silently not applied to the only directories holding data.

And the rule written for exactly this case did not reach them. A
directory the mesh declared and no longer wants is kept, not removed,
when it holds anything the mesh did not put there (ADR 0030). That is
the answer to *what happens to my data when a module goes away*, and it
is written in terms of declared directories: an undeclared one sits
outside it, because the mesh does not know it is there.

Refused where it is written rather than on the machine, which cannot
tell the difference — by the time the host sees the mount it is being
asked to make a directory, which it is perfectly able to do. The fault
is in the manifest, so it is named at the manifest. Same argument as the
action refusal directly above it.

A path under a declared directory counts as declared, as do the files a
module already names: its own secrets, its grants, what it receives.

Every real manifest is checked to still parse, and the refusal bites.
2026-09-01 19:36:01 +02:00

24 lines
486 B
Go

package catalogue
import (
"os"
"path/filepath"
"testing"
)
func TestEveryExampleManifestStillParses(t *testing.T) {
found, err := filepath.Glob("../../examples/modules/*.json")
if err != nil || len(found) == 0 {
t.Fatalf("no example manifests found: %v", err)
}
for _, f := range found {
raw, err := os.ReadFile(f)
if err != nil {
t.Fatal(err)
}
if _, err := ParseManifest(raw); err != nil {
t.Errorf("%s no longer parses: %v", filepath.Base(f), err)
}
}
}