Genesis trusts its registry before it pushes to it (issue 92) #91

Merged
mesh-admin merged 2 commits from fix/92-genesis-trusts-its-registry into main 2026-10-12 14:36:17 +00:00
Contributor

What

Genesis now writes the container runtime's trust of the mesh's registry itself. It does this at the registry step (step 7), before the registry is installed and before the push (step 8). It refuses before any push unless the runtime says it trusts every name. What can be known without writing is checked in preflight (step 1).

  • internal/bootstrap/trust.go:
    • RegistryNames returns the names to trust: the address given and the node's mesh name <node>.<suffix>. Both use the node's registry port Ports.Registry, never the module's default. Loopback is left out because dockerd trusts 127.0.0.0/8 already.
    • TrustTheRegistry writes them through internal/apply, with the same two resources the docker module declares: /etc/docker/daemon.json written into (into: json, beside every other key, ADR 0102) and docker.service reloaded on it, never restarted. A re-run changes nothing and does not reload. It then polls docker info --format '{{json .RegistryConfig}}' until each name is listed as not secure or falls in a trusted range. If one never does, it refuses with the names and says nothing was pushed.
    • RuntimeWillTakeTheTrust runs in preflight and writes nothing. It refuses three cases: daemon.json exists and is not a JSON object; docker.service is not loaded and active; dockerd was started with --insecure-registry, which makes it reject the same directive in its file and so ignore the reload.
  • bootstrap.go: steps 7 and 8 are now one function, RegistryAndPublish, so a test can hold their order. The result reports registry-trusted, and the dry run says which names would be trusted.

Why

Issue 92: genesis pushed the control plane's image to the plain-HTTP registry (ADR 0082) before anything told the runtime to trust it. The docker module, which writes that trust from the artifact store's reach, is applied long after the push. This builds the decision recorded on the issue on 2026-10-11:

  • genesis writes the trust itself, with the same writer, for every name the mesh uses for the registry;
  • the port comes from what the registry serves on the node;
  • the docker module takes the trust over afterwards;
  • genesis refuses if the runtime still does not trust the registry.

TLS and loading the image instead of pushing it were not taken.

Handover, and what it assumes

Genesis keeps no record of what it writes. A carried record would not survive: the retire step re-applies the bundle and removes any carried record the bundle does not name.

The docker module, applied later, declares the mesh name on the node's port. It finds that entry already in a file it has no record of, and under ADR 0102 takes it as its own. That entry does not change at the handover. The module's first apply usually still changes the file and reloads the runtime once, because it also writes live-restore, log-driver and log-opts. A reload stops nothing.

The address the operator gave, when it differs from the mesh name, stays in the file as part of the machine's own configuration, as the hand-written workaround would have.

Assumption, written in the code: the module takes the mesh name over only because its first apply on the node already declares it. Genesis assigns no docker module before the network step (16). If docker were applied earlier, while the reach is empty or 127.0.0.1:<port>, the mesh name would stay the machine's for good. Installing the node's seat holders earlier in genesis must revisit this.

The suffix: the mesh name's suffix is read from MESH_INTERNAL_SUFFIX (default internal), the same variable and default the controller's overlay.InternalName uses. Genesis reads it from its own environment and the controller from its own, so a mesh with a custom suffix must set it for both. The code is copied rather than imported, because the node-engine and its installer depend on nothing that must be installed first (ADR 0005 §3, "Static binary").

How it was tested

internal/bootstrap/trust_test.go uses a fake runtime that trusts whatever its file said at its last reload.

  • The order: TestNothingIsPushedToTheRegistryBeforeTheRuntimeTrustsIt drives RegistryAndPublish (steps 7 and 8) against a runtime that refuses a push to an untrusted registry with the error the first genesis met. It asserts that the reload and the docker info confirmation both come before the first docker tag or docker push. I checked that it fails both when the TrustTheRegistry call is removed and when it is moved after the publish.
  • Writing the trust: both names are written beside the machine's own keys and entries, with one reload and no restart or stop; a re-run does not reload. The port follows the node's setting, loopback is left out, and the suffix variable is honoured.
  • Refusals: a runtime that still refuses after the write is refused before any push. The preflight check refuses the three cases above, accepts a good runtime and an absent file, and never writes the file.
  • The handover: the docker module's declaration applied afterwards leaves the entry, does not reload, and records the entry as its own. An address inside a trusted range counts as trusted.

The ordering test does not run on the parent commit, because RegistryAndPublish did not exist there. It cannot serve as a replay laid over the parent. A replay that runs on the parent would be a mesh-lab bed whose base image does not pre-trust the documentation ranges, as review 73 describes.

The whole ./merge-check.sh passes locally.

Fixes issue 92.

## What Genesis now writes the container runtime's trust of the mesh's registry itself. It does this at the registry step (step 7), before the registry is installed and before the push (step 8). It refuses before any push unless the runtime says it trusts every name. What can be known without writing is checked in preflight (step 1). - `internal/bootstrap/trust.go`: - `RegistryNames` returns the names to trust: the address given and the node's mesh name `<node>.<suffix>`. Both use the node's registry port `Ports.Registry`, never the module's default. Loopback is left out because dockerd trusts `127.0.0.0/8` already. - `TrustTheRegistry` writes them through `internal/apply`, with the same two resources the `docker` module declares: `/etc/docker/daemon.json` written into (`into: json`, beside every other key, ADR 0102) and `docker.service` reloaded on it, never restarted. A re-run changes nothing and does not reload. It then polls `docker info --format '{{json .RegistryConfig}}'` until each name is listed as not secure or falls in a trusted range. If one never does, it refuses with the names and says nothing was pushed. - `RuntimeWillTakeTheTrust` runs in preflight and writes nothing. It refuses three cases: `daemon.json` exists and is not a JSON object; `docker.service` is not loaded and active; dockerd was started with `--insecure-registry`, which makes it reject the same directive in its file and so ignore the reload. - `bootstrap.go`: steps 7 and 8 are now one function, `RegistryAndPublish`, so a test can hold their order. The result reports `registry-trusted`, and the dry run says which names would be trusted. ## Why Issue 92: genesis pushed the control plane's image to the plain-HTTP registry (ADR 0082) before anything told the runtime to trust it. The `docker` module, which writes that trust from the artifact store's reach, is applied long after the push. This builds the decision recorded on the issue on 2026-10-11: - genesis writes the trust itself, with the same writer, for every name the mesh uses for the registry; - the port comes from what the registry serves on the node; - the `docker` module takes the trust over afterwards; - genesis refuses if the runtime still does not trust the registry. TLS and loading the image instead of pushing it were not taken. ## Handover, and what it assumes Genesis keeps no record of what it writes. A carried record would not survive: the retire step re-applies the bundle and removes any carried record the bundle does not name. The `docker` module, applied later, declares the mesh name on the node's port. It finds that entry already in a file it has no record of, and under ADR 0102 takes it as its own. That entry does not change at the handover. The module's first apply usually still changes the file and reloads the runtime once, because it also writes `live-restore`, `log-driver` and `log-opts`. A reload stops nothing. The address the operator gave, when it differs from the mesh name, stays in the file as part of the machine's own configuration, as the hand-written workaround would have. **Assumption, written in the code:** the module takes the mesh name over only because its first apply on the node already declares it. Genesis assigns no `docker` module before the network step (16). If `docker` were applied earlier, while the reach is empty or `127.0.0.1:<port>`, the mesh name would stay the machine's for good. Installing the node's seat holders earlier in genesis must revisit this. **The suffix:** the mesh name's suffix is read from `MESH_INTERNAL_SUFFIX` (default `internal`), the same variable and default the controller's `overlay.InternalName` uses. Genesis reads it from its own environment and the controller from its own, so a mesh with a custom suffix must set it for both. The code is copied rather than imported, because the node-engine and its installer depend on nothing that must be installed first (ADR 0005 §3, "Static binary"). ## How it was tested `internal/bootstrap/trust_test.go` uses a fake runtime that trusts whatever its file said at its last reload. - **The order:** `TestNothingIsPushedToTheRegistryBeforeTheRuntimeTrustsIt` drives `RegistryAndPublish` (steps 7 and 8) against a runtime that refuses a push to an untrusted registry with the error the first genesis met. It asserts that the reload and the `docker info` confirmation both come before the first `docker tag` or `docker push`. I checked that it fails both when the `TrustTheRegistry` call is removed and when it is moved after the publish. - **Writing the trust:** both names are written beside the machine's own keys and entries, with one reload and no restart or stop; a re-run does not reload. The port follows the node's setting, loopback is left out, and the suffix variable is honoured. - **Refusals:** a runtime that still refuses after the write is refused before any push. The preflight check refuses the three cases above, accepts a good runtime and an absent file, and never writes the file. - **The handover:** the `docker` module's declaration applied afterwards leaves the entry, does not reload, and records the entry as its own. An address inside a trusted range counts as trusted. The ordering test does not run on the parent commit, because `RegistryAndPublish` did not exist there. It cannot serve as a replay laid over the parent. A replay that runs on the parent would be a mesh-lab bed whose base image does not pre-trust the documentation ranges, as review 73 describes. The whole `./merge-check.sh` passes locally. Fixes issue 92.
mesh-admin added 1 commit 2026-10-12 14:13:29 +00:00
Have genesis trust its registry before pushing to it (issue 92)
mesh/merge-gate pass: the change touches no module of the mesh's graph
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery superseded: a newer head of the same pull request
41e640d668
Genesis pushed the control plane's image to the mesh's plain-HTTP registry
before anything told the container runtime to trust it; the docker module
that writes that trust is applied long after. Genesis now writes the trust
itself at the registry step, with the same into-json writer and a reload,
for the address given and the node's mesh name on the node's registry
port, and refuses before any push unless the runtime says it trusts each.
The docker module later finds the mesh name there and takes it over
without a change.
Author
Contributor

Delivery novox/mesh-host@0818e4c29ae4 — delivered since 2026-10-12T14:36:21Z

Delivery plan — builds nothing: the change touches no module of the mesh's graph

Transitions

  • 2026-10-12 14:29 (new) → proposed (announced): novox/mesh-host#91's head announced
  • 2026-10-12 14:31 proposed → checked (checked): the verdict names this commit
  • 2026-10-12 14:31 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
  • 2026-10-12 14:36 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
  • 2026-10-12 14:36 published → delivered (done): nothing for a walk to move

The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-host@0818e4c29ae4` — **delivered** since 2026-10-12T14:36:21Z **Delivery plan** — builds nothing: the change touches no module of the mesh's graph **Transitions** - 2026-10-12 14:29 (new) → proposed (announced): novox/mesh-host#91's head announced - 2026-10-12 14:31 proposed → checked (checked): the verdict names this commit - 2026-10-12 14:31 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail - 2026-10-12 14:36 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move - 2026-10-12 14:36 published → delivered (done): nothing for a walk to move The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
mesh-admin left a comment
Author
Contributor

Verdict: request changes at 41e640d668

Independent review against issue 92's 2026-10-11 decision note, ADR 0082 and ADR 0102. I read the diff, the apply package's into-json writer, mesh-controller overlay and artifactStoreAddress on main, the catalogue's docker module on main, and the mesh-lab README and replays. Locally at the head, go vet ./..., go test -race ./internal/bootstrap ./internal/apply and ./merge-check.sh all pass.

Blocking

  1. Nothing tests the fix itself, which is the order of the steps. The fault in issue 92 is that the push comes before the trust. I replaced the TrustTheRegistry call in Run with a no-op, and go test ./internal/bootstrap still passed. The new tests cover TrustTheRegistry on its own. No test fails if a later edit moves or drops the call, so the ordering the issue is about is not held by anything. Please add a test that holds the trust before any push: for example, split step 7–8 into a function that takes Deps and assert that no docker push or docker tag to the registry happens before the trust is written and confirmed. That test would also be the natural base for the replay (see 8).

Non-blocking (fix in the PR text or as a follow-up)

  1. The PR body cites a wrong decision and step number. It says "tier 0 depends on nothing installed first (ADR 0041)". ADR 0041 is "Events are a relationship", so that citation is wrong. The body also says "step 9", but the code numbers the registry step 7 and the push step 8. The placement itself is right: the trust is written before InstallRegistry and before step 8's push, and the dry run names it.
  2. The handover claim is stronger than the code. The comment and body say the docker module's later apply leaves the file unchanged and does not reload. That holds only for insecure-registries. The real module also writes live-restore, log-driver and log-opts, so its first apply usually changes the file and reloads once. A reload is harmless (it is not a restart), but the text should say so. The handover test models a module with only live-restore (pre-seeded) and insecure-registries.
    Adoption also works only if the module's first apply on the node already declares <node>.<suffix>:<port>. addMembers adopts a present member only when there is no record (unrecorded). If the docker module were first applied while the controller's reach was empty or 127.0.0.1:<port> (artifactStoreAddress returns that for a holder that is not yet on the network), its record would exist without the mesh name. The mesh name would then stay "the machine's own" for good, and undeclaring would never remove it. Genesis does not assign docker before step 16 today, so this holds now. It breaks if genesis ever installs the node's seat holders (ADR 0207) early. Please name that assumption in the comment.
  3. Preflight. The decision note asks that the runtime be checked after the write and refused with the reason. runtimeWillSpeakTo does this, and the refusal names the names and says nothing was pushed. However, a refusal now comes at step 7, after the foundation is applied and the node enrolled. Some checks need no write and could be done in step 1: /etc/docker/daemon.json must parse as a JSON object (applyInto refuses otherwise), docker.service must exist and be active, and insecure-registries must not already be a dockerd flag (dockerd rejects a directive given as both flag and file, so the reload is silently ignored). Suggested as a follow-up issue.

Checked and fine

  • ADR 0102 (merge, reload, re-run): the file is written through applyInto, so other keys and existing list members are kept and the original mode is kept. The service resource takes the ReloadService path (systemctl reload), never a restart. The test checks one reload and zero restarts or stops, and that a re-run neither writes nor reloads. The apply runs under store.Lock(o.State) with an empty known state and does not persist a record, so nothing the running host holds is removed.
  • Names: cmd/mesh-bootstrap reconciles --registry's port with Ports.Registry, so the address given and the mesh name use the port the registry is served on. The controller's reach for mesh-artifact-store is overlay.InternalName(holder) + ":" + port, or 127.0.0.1:<port> before the network. The builder pushes to that reach, the controller pulls from it, and the docker module trusts it, so <node>.<suffix>:<port> covers all three. Loopback is left out correctly, because dockerd trusts 127.0.0.0/8 by default. No other name (an overlay IP, the controller's own name) is used for this registry during genesis.
  • MESH_INTERNAL_SUFFIX: the default internal and the leading-dot trim match mesh-controller internal/overlay/names.go. There is one caveat: genesis reads the bootstrap process's environment, and the controller reads its own container's environment. A mesh with a custom suffix must set it in both places. That is worth one line in the comment.
  • The docker info poll: each call is bounded by o.Timeout (30 s), the whole poll by o.Wait (3 min), it polls every answerEvery and stops when the context is cancelled. On a refusal, failed(StepRegistry, …) returns before InstallRegistry and the push. untrusted reads IndexConfigs[name].Secure == false or an IP literal inside InsecureRegistryCIDRs, which matches how dockerd records the two kinds of entry. A missing docker or a podman machine fails earlier, at the apply (systemctl on docker.service), with "the registry's trust could not be written … Nothing has been pushed". That is a clear refusal, though the underlying cause is only in the wrapped error. On rootless docker, state: running would start the system docker.service. That is an edge genesis does not support anyway.
  • Statuses on the head: mesh/merge-gate success ("the change touches no module of the mesh's graph"), mesh/repo-check success ("its merge-check.sh passed"), and mesh/delivery success ("ready: it delivers once merged"). The earlier pending entries were superseded. No reviews existed before this one.

Replay (8)

replay-none would not be honest. A replay is feasible two ways:

  • In mesh-host: the ordering test asked for in 1. It can be laid over the parent commit only if it drives Run (or code that existed there) with fakes.
  • In mesh-lab, as a bed: the base image (src/lifecycle/base.ts) pre-trusts the documentation ranges in daemon.json, which hides the IP case, as the issue says. A bed that skips that line and runs mesh-bootstrap --registry <doc-range IP>:<port> would fail at step 8 on the parent commit and pass on this fix. The mesh-name case (anchor.internal:5000) is not covered by those ranges even today.

I recommend registering R92 as the bed variant, or as the in-repository test once item 1 exists.

Verdict: request changes at 41e640d66888072454a0b17eb01b8bc6aa182690 Independent review against issue 92's 2026-10-11 decision note, ADR 0082 and ADR 0102. I read the diff, the apply package's into-json writer, mesh-controller `overlay` and `artifactStoreAddress` on main, the catalogue's `docker` module on main, and the mesh-lab README and replays. Locally at the head, `go vet ./...`, `go test -race ./internal/bootstrap ./internal/apply` and `./merge-check.sh` all pass. ## Blocking 1. **Nothing tests the fix itself, which is the order of the steps.** The fault in issue 92 is that the push comes before the trust. I replaced the `TrustTheRegistry` call in `Run` with a no-op, and `go test ./internal/bootstrap` still passed. The new tests cover `TrustTheRegistry` on its own. No test fails if a later edit moves or drops the call, so the ordering the issue is about is not held by anything. Please add a test that holds the trust before any push: for example, split step 7–8 into a function that takes `Deps` and assert that no `docker push` or `docker tag` to the registry happens before the trust is written and confirmed. That test would also be the natural base for the replay (see 8). ## Non-blocking (fix in the PR text or as a follow-up) 2. **The PR body cites a wrong decision and step number.** It says "tier 0 depends on nothing installed first (ADR 0041)". ADR 0041 is "Events are a relationship", so that citation is wrong. The body also says "step 9", but the code numbers the registry step 7 and the push step 8. The placement itself is right: the trust is written before `InstallRegistry` and before step 8's push, and the dry run names it. 3. **The handover claim is stronger than the code.** The comment and body say the `docker` module's later apply leaves the file unchanged and does not reload. That holds only for `insecure-registries`. The real module also writes `live-restore`, `log-driver` and `log-opts`, so its first apply usually changes the file and reloads once. A reload is harmless (it is not a restart), but the text should say so. The handover test models a module with only `live-restore` (pre-seeded) and `insecure-registries`. Adoption also works only if the module's **first** apply on the node already declares `<node>.<suffix>:<port>`. `addMembers` adopts a present member only when there is no record (`unrecorded`). If the `docker` module were first applied while the controller's reach was empty or `127.0.0.1:<port>` (`artifactStoreAddress` returns that for a holder that is not yet on the network), its record would exist without the mesh name. The mesh name would then stay "the machine's own" for good, and undeclaring would never remove it. Genesis does not assign `docker` before step 16 today, so this holds now. It breaks if genesis ever installs the node's seat holders (ADR 0207) early. Please name that assumption in the comment. 4. **Preflight.** The decision note asks that the runtime be checked after the write and refused with the reason. `runtimeWillSpeakTo` does this, and the refusal names the names and says nothing was pushed. However, a refusal now comes at step 7, after the foundation is applied and the node enrolled. Some checks need no write and could be done in step 1: `/etc/docker/daemon.json` must parse as a JSON object (`applyInto` refuses otherwise), `docker.service` must exist and be active, and `insecure-registries` must not already be a dockerd flag (dockerd rejects a directive given as both flag and file, so the reload is silently ignored). Suggested as a follow-up issue. ## Checked and fine - **ADR 0102 (merge, reload, re-run):** the file is written through `applyInto`, so other keys and existing list members are kept and the original mode is kept. The service resource takes the `ReloadService` path (`systemctl reload`), never a restart. The test checks one reload and zero restarts or stops, and that a re-run neither writes nor reloads. The apply runs under `store.Lock(o.State)` with an empty known state and does not persist a record, so nothing the running host holds is removed. - **Names:** `cmd/mesh-bootstrap` reconciles `--registry`'s port with `Ports.Registry`, so the address given and the mesh name use the port the registry is served on. The controller's reach for `mesh-artifact-store` is `overlay.InternalName(holder) + ":" + port`, or `127.0.0.1:<port>` before the network. The builder pushes to that reach, the controller pulls from it, and the docker module trusts it, so `<node>.<suffix>:<port>` covers all three. Loopback is left out correctly, because dockerd trusts `127.0.0.0/8` by default. No other name (an overlay IP, the controller's own name) is used for this registry during genesis. - **`MESH_INTERNAL_SUFFIX`:** the default `internal` and the leading-dot trim match mesh-controller `internal/overlay/names.go`. There is one caveat: genesis reads the bootstrap process's environment, and the controller reads its own container's environment. A mesh with a custom suffix must set it in both places. That is worth one line in the comment. - **The `docker info` poll:** each call is bounded by `o.Timeout` (30 s), the whole poll by `o.Wait` (3 min), it polls every `answerEvery` and stops when the context is cancelled. On a refusal, `failed(StepRegistry, …)` returns before `InstallRegistry` and the push. `untrusted` reads `IndexConfigs[name].Secure == false` or an IP literal inside `InsecureRegistryCIDRs`, which matches how dockerd records the two kinds of entry. A missing docker or a podman machine fails earlier, at the apply (`systemctl` on `docker.service`), with "the registry's trust could not be written … Nothing has been pushed". That is a clear refusal, though the underlying cause is only in the wrapped error. On rootless docker, `state: running` would start the system `docker.service`. That is an edge genesis does not support anyway. - **Statuses on the head:** `mesh/merge-gate` success ("the change touches no module of the mesh's graph"), `mesh/repo-check` success ("its merge-check.sh passed"), and `mesh/delivery` success ("ready: it delivers once merged"). The earlier pending entries were superseded. No reviews existed before this one. ## Replay (8) `replay-none` would not be honest. A replay is feasible two ways: - **In mesh-host:** the ordering test asked for in 1. It can be laid over the parent commit only if it drives `Run` (or code that existed there) with fakes. - **In mesh-lab, as a bed:** the base image (`src/lifecycle/base.ts`) pre-trusts the documentation ranges in `daemon.json`, which hides the IP case, as the issue says. A bed that skips that line and runs `mesh-bootstrap --registry <doc-range IP>:<port>` would fail at step 8 on the parent commit and pass on this fix. The mesh-name case (`anchor.internal:5000`) is not covered by those ranges even today. I recommend registering R92 as the bed variant, or as the in-repository test once item 1 exists.
jschoubben added 1 commit 2026-10-12 14:29:16 +00:00
Hold the trust-before-push order by a test, and refuse early what would stop it (issue 92)
mesh/merge-gate pass: the change touches no module of the mesh's graph
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered
0818e4c29a
The fix is an order, and nothing failed if the trust call moved after the
push or went: steps 7 and 8 are now one function a test drives against a
runtime that refuses an untrusted push. Preflight now refuses, before
anything is raised, a runtime file that is no JSON object, a docker.service
that is not loaded and active, and a dockerd started with
--insecure-registry, which would refuse the reload. The comment names the
order the docker module's takeover rests on.
mesh-admin left a comment
Author
Contributor

Verdict: approve at 0818e4c29a

Re-review against review 73. Every point from it is addressed. Locally at this head, go vet ./..., go test -race ./internal/bootstrap ./internal/apply and ./merge-check.sh all pass. The three statuses on the head are green: mesh/merge-gate ("the change touches no module of the mesh's graph"), mesh/repo-check ("its merge-check.sh passed") and mesh/delivery ("ready: it delivers once merged").

Review 73, point by point

  1. The order is now held by a test (was blocking). Steps 7 and 8 are one function, RegistryAndPublish. TestNothingIsPushedToTheRegistryBeforeTheRuntimeTrustsIt runs it against a runtime that refuses a push to an untrusted registry with the error the first genesis met. It asserts the order: reload, then the docker info confirmation, then the first tag or push. I checked that it fails both ways:
    • With the TrustTheRegistry call replaced by a no-op, the push is refused and the test fails.
    • With the call moved after PublishControlPlane, the push again comes first and the test fails.
      One gap remains, and I am not blocking on it: Run calling RegistryAndPublish is itself untested. That one-line call is low risk.
  2. PR text. It now says step 7 and step 8. "Depends on nothing that must be installed first" is now cited as ADR 0005 §3 ("Static binary"), which I checked in the knowledge base.
  3. Assumption comment. trust.go now says that the docker module's first apply usually reloads the runtime once, for live-restore, log-driver and log-opts. It also names the order assumption (no docker module before the network step 16), what happens if that ever changes, and that installing seat holders earlier must revisit it.
  4. Preflight. RuntimeWillTakeTheTrust runs in step 1, only when genesis pivots and only when there is a non-loopback name to trust. It refuses three cases: daemon.json exists and is not a JSON object, docker.service is not loaded and active, or dockerd was started with --insecure-registry. The table test covers each refusal, plus a good runtime and an absent file, and checks that the file is never written.
  5. Suffix note. The comment says that genesis and the controller each read MESH_INTERNAL_SUFFIX from their own environment, so a custom suffix must be set for both.

Can the preflight check refuse a healthy machine?

  • Socket activation: the check runs after waitForRuntime and RefuseAMachineInUse, which have already had the daemon answer docker calls. A socket-activated docker.service is therefore active by then, not merely its socket.
  • Process name: the check reads only the arguments of MainPID's command line, never the program name. A wrapper or a renamed binary is no problem. Flags expanded from an EnvironmentFile appear in that command line, so they are caught. An unreadable /proc/<pid>/cmdline or a MainPID of 0 lets the machine pass rather than refusing it.
  • The flag refusal is correct even when the flag already trusts the right names. dockerd rejects a directive given both as a flag and in its file. Writing the file would then make the reload fail, and the next start of dockerd would fail outright. The docker module would hit the same conflict later.
  • Two narrow edges are refused by design. A runtime not run by systemd as docker.service (rootless docker, podman, a snap) is refused with a reason that says so. Genesis does not support those today, and the bundle declares docker.service itself.
  • One transient false refusal is possible. A unit caught mid-reload (ActiveState=reloading) would be refused. Re-running genesis clears it. I mention it only for completeness.

Replay

The PR text says correctly that the ordering test cannot run on the parent commit, because RegistryAndPublish did not exist there. As review 73 said, the replay that can run on the parent is a mesh-lab bed whose base image does not pre-trust the documentation ranges. Issue 92 should be resolved with that replay registered, or with a reason no replay exists if the bed is not built. A reason would be weak here, because the bed is feasible.

Verdict: approve at 0818e4c29ae48e5b909f4eec97f1130951448c35 Re-review against review 73. Every point from it is addressed. Locally at this head, `go vet ./...`, `go test -race ./internal/bootstrap ./internal/apply` and `./merge-check.sh` all pass. The three statuses on the head are green: `mesh/merge-gate` ("the change touches no module of the mesh's graph"), `mesh/repo-check` ("its merge-check.sh passed") and `mesh/delivery` ("ready: it delivers once merged"). ## Review 73, point by point 1. **The order is now held by a test (was blocking).** Steps 7 and 8 are one function, `RegistryAndPublish`. `TestNothingIsPushedToTheRegistryBeforeTheRuntimeTrustsIt` runs it against a runtime that refuses a push to an untrusted registry with the error the first genesis met. It asserts the order: reload, then the `docker info` confirmation, then the first tag or push. I checked that it fails both ways: - With the `TrustTheRegistry` call replaced by a no-op, the push is refused and the test fails. - With the call moved after `PublishControlPlane`, the push again comes first and the test fails. One gap remains, and I am not blocking on it: `Run` calling `RegistryAndPublish` is itself untested. That one-line call is low risk. 2. **PR text.** It now says step 7 and step 8. "Depends on nothing that must be installed first" is now cited as ADR 0005 §3 ("Static binary"), which I checked in the knowledge base. 3. **Assumption comment.** `trust.go` now says that the `docker` module's first apply usually reloads the runtime once, for `live-restore`, `log-driver` and `log-opts`. It also names the order assumption (no `docker` module before the network step 16), what happens if that ever changes, and that installing seat holders earlier must revisit it. 4. **Preflight.** `RuntimeWillTakeTheTrust` runs in step 1, only when genesis pivots and only when there is a non-loopback name to trust. It refuses three cases: `daemon.json` exists and is not a JSON object, `docker.service` is not loaded and active, or dockerd was started with `--insecure-registry`. The table test covers each refusal, plus a good runtime and an absent file, and checks that the file is never written. 5. **Suffix note.** The comment says that genesis and the controller each read `MESH_INTERNAL_SUFFIX` from their own environment, so a custom suffix must be set for both. ## Can the preflight check refuse a healthy machine? - **Socket activation:** the check runs after `waitForRuntime` and `RefuseAMachineInUse`, which have already had the daemon answer `docker` calls. A socket-activated `docker.service` is therefore active by then, not merely its socket. - **Process name:** the check reads only the arguments of `MainPID`'s command line, never the program name. A wrapper or a renamed binary is no problem. Flags expanded from an `EnvironmentFile` appear in that command line, so they are caught. An unreadable `/proc/<pid>/cmdline` or a `MainPID` of 0 lets the machine pass rather than refusing it. - **The flag refusal is correct even when the flag already trusts the right names.** dockerd rejects a directive given both as a flag and in its file. Writing the file would then make the reload fail, and the next start of dockerd would fail outright. The `docker` module would hit the same conflict later. - **Two narrow edges are refused by design.** A runtime not run by systemd as `docker.service` (rootless docker, podman, a snap) is refused with a reason that says so. Genesis does not support those today, and the bundle declares `docker.service` itself. - **One transient false refusal is possible.** A unit caught mid-reload (`ActiveState=reloading`) would be refused. Re-running genesis clears it. I mention it only for completeness. ## Replay The PR text says correctly that the ordering test cannot run on the parent commit, because `RegistryAndPublish` did not exist there. As review 73 said, the replay that can run on the parent is a mesh-lab bed whose base image does not pre-trust the documentation ranges. Issue 92 should be resolved with that replay registered, or with a reason no replay exists if the bed is not built. A reason would be weak here, because the bed is feasible.
mesh-admin merged commit dd9ab7927d into main 2026-10-12 14:36:17 +00:00
mesh-admin deleted branch fix/92-genesis-trusts-its-registry 2026-10-12 14:36:17 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-host#91