From a865fc7d7913f7c55f26c4571eca39e25437cf67 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 27 Sep 2026 00:03:30 +0200 Subject: [PATCH] 128 review: located; the fix as built (block, at, never held, order) --- .../00-report.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/04-ISSUES/128-the-hosts-file-is-written-whole/00-report.md b/04-ISSUES/128-the-hosts-file-is-written-whole/00-report.md index 8e5b9f5..fa02a00 100644 --- a/04-ISSUES/128-the-hosts-file-is-written-whole/00-report.md +++ b/04-ISSUES/128-the-hosts-file-is-written-whole/00-report.md @@ -1,5 +1,5 @@ --- -status: open +status: located opened: 2026-09-26 located-in: [mesh-controller internal/catalogue/facts.go, mesh-host internal/apply] --- @@ -51,6 +51,20 @@ private network loses that name too. - A converge preview that names a held file the take would replace *whole*, with its line count before and after, so a person sees "hosts: 31 lines → 12" before the flip. +## The fix, as built (in review) + +- **Host:** a file resource may say `"into": "block"`. The host owns only the lines between + `# BEGIN mesh ` and `# END mesh ` and keeps everything outside them byte for byte. A + new region goes at the `end` by default, or at the `start` (`"at": "start"`) for files where a + line's meaning depends on what stands above it; a region already present is never moved. + Undeclared, what the region held before is put back, or the region is removed and nothing + else. Replacing nothing, it is written on an adopted node without being held — so a machine + gets the mesh's names before its private network is taken. +- **Controller:** `node-names` is a fact written into a shared file, emitted as that region: the + mesh's names only, no header, no `localhost`, no `127.0.1.1` line. +- **Order:** a host older than the block mode refuses the whole declaration on an unknown + `into`, so hosts are upgraded before the controller that emits it. + ## Evidence to carry into diagnosis - `internal/catalogue/facts.go`, `nodeNames`: the complete file is built here.