Unify trunk on main: initialization → main #3
@@ -727,13 +727,19 @@ test("the builder is a module the mesh assigns, with a credential the mesh deliv
|
||||
// And it works: the mesh asks this builder to build something, and it does. Answering is the
|
||||
// only proof that the delivered credential authenticates — a container that is up with a
|
||||
// credential it cannot use looks identical from outside.
|
||||
await must("anchor", `mkdir -p /root/built && printf %s '{"module":"built","version":"1",` +
|
||||
// Somewhere the builder can actually see. A builder that is a module runs in a container, so
|
||||
// the machine's filesystem is not its own — a path like /root only works for a builder somebody
|
||||
// started on the host, which is what the first build above used. In a real mesh a module is
|
||||
// cloned from the forge over a URL; here it goes in the directory the module already mounts,
|
||||
// which is the same fact wearing different clothes.
|
||||
const repo = "/var/lib/mesh/builder/repositories/built";
|
||||
await must("anchor", `mkdir -p ${repo} && printf %s '{"module":"built","version":"1",` +
|
||||
`"resources":[{"id":"marker","type":"file","path":"/etc/built","content":"yes","mode":"0644"}]}' ` +
|
||||
`> /root/built/module.json`);
|
||||
await must("anchor", `cd /root/built && git init -q . && git add -A && ` +
|
||||
`> ${repo}/module.json`);
|
||||
await must("anchor", `cd ${repo} && git init -q . && git add -A && ` +
|
||||
`git -c user.email=lab -c user.name=lab commit -qm built`);
|
||||
try {
|
||||
await mesh("build /root/built --wait 300s", 420_000);
|
||||
await mesh(`build ${repo} --wait 300s`, 420_000);
|
||||
} catch (why) {
|
||||
// The builder's own account of itself. Without it the failure is "nothing consumed the
|
||||
// queue", which names no cause and is the same sentence whether the credential was refused,
|
||||
|
||||
Reference in New Issue
Block a user